diff --git a/services/iaas/api_default_test.go b/services/iaas/api_default_test.go index d5d7ab2c2..922119997 100644 --- a/services/iaas/api_default_test.go +++ b/services/iaas/api_default_test.go @@ -18,22 +18,23 @@ import ( "strings" "testing" + "github.com/google/uuid" "github.com/stackitcloud/stackit-sdk-go/core/config" ) func Test_iaas_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService AddNetworkToServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/networks/{networkId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/networks/{networkId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + networkIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -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() @@ -64,9 +65,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - networkId := "networkId" + projectId := projectIdValue + serverId := serverIdValue + networkId := networkIdValue reqErr := apiClient.AddNetworkToServer(context.Background(), projectId, serverId, networkId).Execute() @@ -76,16 +77,16 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService AddNicToServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/nics/{nicId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - nicIdValue := "nicId" - path = strings.Replace(path, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/nics/{nicId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + nicIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -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() @@ -116,9 +117,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - nicId := "nicId" + projectId := projectIdValue + serverId := serverIdValue + nicId := nicIdValue reqErr := apiClient.AddNicToServer(context.Background(), projectId, serverId, nicId).Execute() @@ -128,16 +129,16 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService AddPublicIpToServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - publicIpIdValue := "publicIpId" - path = strings.Replace(path, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + publicIpIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -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() @@ -168,9 +169,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - publicIpId := "publicIpId" + projectId := projectIdValue + serverId := serverIdValue + publicIpId := publicIpIdValue reqErr := apiClient.AddPublicIpToServer(context.Background(), projectId, serverId, publicIpId).Execute() @@ -180,16 +181,16 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService AddSecurityGroupToServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - securityGroupIdValue := "securityGroupId" - path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + securityGroupIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -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() @@ -220,9 +221,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - securityGroupId := "securityGroupId" + projectId := projectIdValue + serverId := serverIdValue + securityGroupId := securityGroupIdValue reqErr := apiClient.AddSecurityGroupToServer(context.Background(), projectId, serverId, securityGroupId).Execute() @@ -232,16 +233,16 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService AddServiceAccountToServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) serviceAccountMailValue := "serviceAccountMail" - path = strings.Replace(path, "{"+"serviceAccountMail"+"}", url.PathEscape(ParameterValueToString(serviceAccountMailValue, "serviceAccountMail")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceAccountMail"+"}", url.PathEscape(ParameterValueToString(serviceAccountMailValue, "serviceAccountMail")), -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 := ServiceAccountMailListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -275,31 +276,31 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - serviceAccountMail := "serviceAccountMail" + projectId := projectIdValue + serverId := serverIdValue + serviceAccountMail := serviceAccountMailValue resp, reqErr := apiClient.AddServiceAccountToServer(context.Background(), projectId, serverId, serviceAccountMail).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 AddVolumeToServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - volumeIdValue := "volumeId" - path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + volumeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -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 := VolumeAttachment{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -333,27 +334,27 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - volumeId := "volumeId" + projectId := projectIdValue + serverId := serverIdValue + volumeId := volumeIdValue resp, reqErr := apiClient.AddVolumeToServer(context.Background(), projectId, serverId, volumeId).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 CreateAffinityGroup", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/affinity-groups" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/affinity-groups" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := AffinityGroup{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -387,7 +388,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue createAffinityGroupPayload := CreateAffinityGroupPayload{} resp, reqErr := apiClient.CreateAffinityGroup(context.Background(), projectId).CreateAffinityGroupPayload(createAffinityGroupPayload).Execute() @@ -395,18 +396,18 @@ func Test_iaas_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 CreateBackup", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/backups" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/backups" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := Backup{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -440,7 +441,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue createBackupPayload := CreateBackupPayload{} resp, reqErr := apiClient.CreateBackup(context.Background(), projectId).CreateBackupPayload(createBackupPayload).Execute() @@ -448,18 +449,18 @@ func Test_iaas_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 CreateImage", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/images" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/images" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := ImageCreateResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -493,7 +494,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue createImagePayload := CreateImagePayload{} resp, reqErr := apiClient.CreateImage(context.Background(), projectId).CreateImagePayload(createImagePayload).Execute() @@ -501,16 +502,16 @@ func Test_iaas_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 CreateKeyPair", func(t *testing.T) { - path := "/v1beta1/keypairs" + _apiUrlPath := "/v1beta1/keypairs" testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := Keypair{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -551,18 +552,18 @@ func Test_iaas_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 CreateNetwork", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/networks" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/networks" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := Network{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -596,7 +597,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue createNetworkPayload := CreateNetworkPayload{} resp, reqErr := apiClient.CreateNetwork(context.Background(), projectId).CreateNetworkPayload(createNetworkPayload).Execute() @@ -604,18 +605,18 @@ func Test_iaas_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 CreateNetworkArea", func(t *testing.T) { - path := "/v1beta1/organizations/{organizationId}/network-areas" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + _apiUrlPath := "/v1beta1/organizations/{organizationId}/network-areas" + organizationIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -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 := NetworkArea{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -649,7 +650,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" + organizationId := organizationIdValue createNetworkAreaPayload := CreateNetworkAreaPayload{} resp, reqErr := apiClient.CreateNetworkArea(context.Background(), organizationId).CreateNetworkAreaPayload(createNetworkAreaPayload).Execute() @@ -657,20 +658,20 @@ func Test_iaas_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 CreateNetworkAreaRange", func(t *testing.T) { - path := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - areaIdValue := "areaId" - path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + _apiUrlPath := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges" + organizationIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -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 := NetworkRangeListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -704,8 +705,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" - areaId := "areaId" + organizationId := organizationIdValue + areaId := areaIdValue createNetworkAreaRangePayload := CreateNetworkAreaRangePayload{} resp, reqErr := apiClient.CreateNetworkAreaRange(context.Background(), organizationId, areaId).CreateNetworkAreaRangePayload(createNetworkAreaRangePayload).Execute() @@ -713,20 +714,20 @@ func Test_iaas_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 CreateNetworkAreaRoute", func(t *testing.T) { - path := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - areaIdValue := "areaId" - path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + _apiUrlPath := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes" + organizationIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -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 := RouteListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -760,8 +761,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" - areaId := "areaId" + organizationId := organizationIdValue + areaId := areaIdValue createNetworkAreaRoutePayload := CreateNetworkAreaRoutePayload{} resp, reqErr := apiClient.CreateNetworkAreaRoute(context.Background(), organizationId, areaId).CreateNetworkAreaRoutePayload(createNetworkAreaRoutePayload).Execute() @@ -769,20 +770,20 @@ func Test_iaas_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 CreateNic", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/networks/{networkId}/nics" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/networks/{networkId}/nics" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + networkIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -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 := NIC{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -816,8 +817,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - networkId := "networkId" + projectId := projectIdValue + networkId := networkIdValue createNicPayload := CreateNicPayload{} resp, reqErr := apiClient.CreateNic(context.Background(), projectId, networkId).CreateNicPayload(createNicPayload).Execute() @@ -825,18 +826,18 @@ func Test_iaas_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 CreatePublicIP", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/public-ips" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/public-ips" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := PublicIp{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -870,7 +871,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue createPublicIPPayload := CreatePublicIPPayload{} resp, reqErr := apiClient.CreatePublicIP(context.Background(), projectId).CreatePublicIPPayload(createPublicIPPayload).Execute() @@ -878,18 +879,18 @@ func Test_iaas_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 CreateSecurityGroup", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/security-groups" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/security-groups" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := SecurityGroup{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -923,7 +924,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue createSecurityGroupPayload := CreateSecurityGroupPayload{} resp, reqErr := apiClient.CreateSecurityGroup(context.Background(), projectId).CreateSecurityGroupPayload(createSecurityGroupPayload).Execute() @@ -931,20 +932,20 @@ func Test_iaas_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 CreateSecurityGroupRule", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/security-groups/{securityGroupId}/rules" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - securityGroupIdValue := "securityGroupId" - path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/security-groups/{securityGroupId}/rules" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + securityGroupIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -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 := SecurityGroupRule{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -978,8 +979,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - securityGroupId := "securityGroupId" + projectId := projectIdValue + securityGroupId := securityGroupIdValue createSecurityGroupRulePayload := CreateSecurityGroupRulePayload{} resp, reqErr := apiClient.CreateSecurityGroupRule(context.Background(), projectId, securityGroupId).CreateSecurityGroupRulePayload(createSecurityGroupRulePayload).Execute() @@ -987,18 +988,18 @@ func Test_iaas_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 CreateServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := Server{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -1032,7 +1033,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue createServerPayload := CreateServerPayload{} resp, reqErr := apiClient.CreateServer(context.Background(), projectId).CreateServerPayload(createServerPayload).Execute() @@ -1040,18 +1041,18 @@ func Test_iaas_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 CreateSnapshot", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/snapshots" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/snapshots" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := Snapshot{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -1085,7 +1086,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue createSnapshotPayload := CreateSnapshotPayload{} resp, reqErr := apiClient.CreateSnapshot(context.Background(), projectId).CreateSnapshotPayload(createSnapshotPayload).Execute() @@ -1093,18 +1094,18 @@ func Test_iaas_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 CreateVolume", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/volumes" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/volumes" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := Volume{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -1138,7 +1139,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue createVolumePayload := CreateVolumePayload{} resp, reqErr := apiClient.CreateVolume(context.Background(), projectId).CreateVolumePayload(createVolumePayload).Execute() @@ -1146,20 +1147,20 @@ func Test_iaas_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 DeallocateServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/deallocate" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/deallocate" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -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() @@ -1190,8 +1191,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue reqErr := apiClient.DeallocateServer(context.Background(), projectId, serverId).Execute() @@ -1201,14 +1202,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteAffinityGroup", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/affinity-groups/{affinityGroupId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - affinityGroupIdValue := "affinityGroupId" - path = strings.Replace(path, "{"+"affinityGroupId"+"}", url.PathEscape(ParameterValueToString(affinityGroupIdValue, "affinityGroupId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/affinity-groups/{affinityGroupId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + affinityGroupIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"affinityGroupId"+"}", url.PathEscape(ParameterValueToString(affinityGroupIdValue, "affinityGroupId")), -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() @@ -1239,8 +1240,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - affinityGroupId := "affinityGroupId" + projectId := projectIdValue + affinityGroupId := affinityGroupIdValue reqErr := apiClient.DeleteAffinityGroup(context.Background(), projectId, affinityGroupId).Execute() @@ -1250,14 +1251,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteBackup", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/backups/{backupId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - backupIdValue := "backupId" - path = strings.Replace(path, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/backups/{backupId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + backupIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -1288,8 +1289,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - backupId := "backupId" + projectId := projectIdValue + backupId := backupIdValue reqErr := apiClient.DeleteBackup(context.Background(), projectId, backupId).Execute() @@ -1299,14 +1300,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteImage", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/images/{imageId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - imageIdValue := "imageId" - path = strings.Replace(path, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/images/{imageId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + imageIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -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() @@ -1337,8 +1338,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - imageId := "imageId" + projectId := projectIdValue + imageId := imageIdValue reqErr := apiClient.DeleteImage(context.Background(), projectId, imageId).Execute() @@ -1348,14 +1349,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteImageShare", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/images/{imageId}/share" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - imageIdValue := "imageId" - path = strings.Replace(path, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/images/{imageId}/share" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + imageIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -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() @@ -1386,8 +1387,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - imageId := "imageId" + projectId := projectIdValue + imageId := imageIdValue reqErr := apiClient.DeleteImageShare(context.Background(), projectId, imageId).Execute() @@ -1397,16 +1398,16 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteImageShareConsumer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - imageIdValue := "imageId" - path = strings.Replace(path, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) - consumerProjectIdValue := "consumerProjectId" - path = strings.Replace(path, "{"+"consumerProjectId"+"}", url.PathEscape(ParameterValueToString(consumerProjectIdValue, "consumerProjectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + imageIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) + consumerProjectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"consumerProjectId"+"}", url.PathEscape(ParameterValueToString(consumerProjectIdValue, "consumerProjectId")), -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() @@ -1437,9 +1438,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - imageId := "imageId" - consumerProjectId := "consumerProjectId" + projectId := projectIdValue + imageId := imageIdValue + consumerProjectId := consumerProjectIdValue reqErr := apiClient.DeleteImageShareConsumer(context.Background(), projectId, imageId, consumerProjectId).Execute() @@ -1449,12 +1450,12 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteKeyPair", func(t *testing.T) { - path := "/v1beta1/keypairs/{keypairName}" + _apiUrlPath := "/v1beta1/keypairs/{keypairName}" keypairNameValue := "keypairName" - path = strings.Replace(path, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -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() @@ -1485,7 +1486,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - keypairName := "keypairName" + keypairName := keypairNameValue reqErr := apiClient.DeleteKeyPair(context.Background(), keypairName).Execute() @@ -1495,14 +1496,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteNetwork", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/networks/{networkId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/networks/{networkId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + networkIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -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() @@ -1533,8 +1534,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - networkId := "networkId" + projectId := projectIdValue + networkId := networkIdValue reqErr := apiClient.DeleteNetwork(context.Background(), projectId, networkId).Execute() @@ -1544,14 +1545,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteNetworkArea", func(t *testing.T) { - path := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - areaIdValue := "areaId" - path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + _apiUrlPath := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}" + organizationIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -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() @@ -1582,8 +1583,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" - areaId := "areaId" + organizationId := organizationIdValue + areaId := areaIdValue reqErr := apiClient.DeleteNetworkArea(context.Background(), organizationId, areaId).Execute() @@ -1593,16 +1594,16 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteNetworkAreaRange", func(t *testing.T) { - path := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - areaIdValue := "areaId" - path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) - networkRangeIdValue := "networkRangeId" - path = strings.Replace(path, "{"+"networkRangeId"+"}", url.PathEscape(ParameterValueToString(networkRangeIdValue, "networkRangeId")), -1) + _apiUrlPath := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}" + organizationIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + networkRangeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkRangeId"+"}", url.PathEscape(ParameterValueToString(networkRangeIdValue, "networkRangeId")), -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() @@ -1633,9 +1634,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" - areaId := "areaId" - networkRangeId := "networkRangeId" + organizationId := organizationIdValue + areaId := areaIdValue + networkRangeId := networkRangeIdValue reqErr := apiClient.DeleteNetworkAreaRange(context.Background(), organizationId, areaId, networkRangeId).Execute() @@ -1645,16 +1646,16 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteNetworkAreaRoute", func(t *testing.T) { - path := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - areaIdValue := "areaId" - path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) - routeIdValue := "routeId" - path = strings.Replace(path, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(routeIdValue, "routeId")), -1) + _apiUrlPath := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + organizationIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + routeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(routeIdValue, "routeId")), -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() @@ -1685,9 +1686,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" - areaId := "areaId" - routeId := "routeId" + organizationId := organizationIdValue + areaId := areaIdValue + routeId := routeIdValue reqErr := apiClient.DeleteNetworkAreaRoute(context.Background(), organizationId, areaId, routeId).Execute() @@ -1697,16 +1698,16 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteNic", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/networks/{networkId}/nics/{nicId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) - nicIdValue := "nicId" - path = strings.Replace(path, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + networkIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + nicIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -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() @@ -1737,9 +1738,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - networkId := "networkId" - nicId := "nicId" + projectId := projectIdValue + networkId := networkIdValue + nicId := nicIdValue reqErr := apiClient.DeleteNic(context.Background(), projectId, networkId, nicId).Execute() @@ -1749,14 +1750,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeletePublicIP", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/public-ips/{publicIpId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - publicIpIdValue := "publicIpId" - path = strings.Replace(path, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/public-ips/{publicIpId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + publicIpIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -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() @@ -1787,8 +1788,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - publicIpId := "publicIpId" + projectId := projectIdValue + publicIpId := publicIpIdValue reqErr := apiClient.DeletePublicIP(context.Background(), projectId, publicIpId).Execute() @@ -1798,14 +1799,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteSecurityGroup", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/security-groups/{securityGroupId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - securityGroupIdValue := "securityGroupId" - path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/security-groups/{securityGroupId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + securityGroupIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -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() @@ -1836,8 +1837,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - securityGroupId := "securityGroupId" + projectId := projectIdValue + securityGroupId := securityGroupIdValue reqErr := apiClient.DeleteSecurityGroup(context.Background(), projectId, securityGroupId).Execute() @@ -1847,16 +1848,16 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteSecurityGroupRule", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - securityGroupIdValue := "securityGroupId" - path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) - securityGroupRuleIdValue := "securityGroupRuleId" - path = strings.Replace(path, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(securityGroupRuleIdValue, "securityGroupRuleId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + securityGroupIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) + securityGroupRuleIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(securityGroupRuleIdValue, "securityGroupRuleId")), -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() @@ -1887,9 +1888,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - securityGroupId := "securityGroupId" - securityGroupRuleId := "securityGroupRuleId" + projectId := projectIdValue + securityGroupId := securityGroupIdValue + securityGroupRuleId := securityGroupRuleIdValue reqErr := apiClient.DeleteSecurityGroupRule(context.Background(), projectId, securityGroupId, securityGroupRuleId).Execute() @@ -1899,14 +1900,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -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() @@ -1937,8 +1938,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue reqErr := apiClient.DeleteServer(context.Background(), projectId, serverId).Execute() @@ -1948,14 +1949,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteSnapshot", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/snapshots/{snapshotId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - snapshotIdValue := "snapshotId" - path = strings.Replace(path, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(snapshotIdValue, "snapshotId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/snapshots/{snapshotId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + snapshotIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(snapshotIdValue, "snapshotId")), -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() @@ -1986,8 +1987,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - snapshotId := "snapshotId" + projectId := projectIdValue + snapshotId := snapshotIdValue reqErr := apiClient.DeleteSnapshot(context.Background(), projectId, snapshotId).Execute() @@ -1997,14 +1998,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService DeleteVolume", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/volumes/{volumeId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - volumeIdValue := "volumeId" - path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/volumes/{volumeId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + volumeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -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() @@ -2035,8 +2036,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - volumeId := "volumeId" + projectId := projectIdValue + volumeId := volumeIdValue reqErr := apiClient.DeleteVolume(context.Background(), projectId, volumeId).Execute() @@ -2046,14 +2047,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetAffinityGroup", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/affinity-groups/{affinityGroupId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - affinityGroupIdValue := "affinityGroupId" - path = strings.Replace(path, "{"+"affinityGroupId"+"}", url.PathEscape(ParameterValueToString(affinityGroupIdValue, "affinityGroupId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/affinity-groups/{affinityGroupId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + affinityGroupIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"affinityGroupId"+"}", url.PathEscape(ParameterValueToString(affinityGroupIdValue, "affinityGroupId")), -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 := AffinityGroup{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -2087,30 +2088,30 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - affinityGroupId := "affinityGroupId" + projectId := projectIdValue + affinityGroupId := affinityGroupIdValue resp, reqErr := apiClient.GetAffinityGroup(context.Background(), projectId, affinityGroupId).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 GetAttachedVolume", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - volumeIdValue := "volumeId" - path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + volumeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -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 := VolumeAttachment{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -2144,29 +2145,29 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - volumeId := "volumeId" + projectId := projectIdValue + serverId := serverIdValue + volumeId := volumeIdValue resp, reqErr := apiClient.GetAttachedVolume(context.Background(), projectId, serverId, volumeId).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 GetBackup", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/backups/{backupId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - backupIdValue := "backupId" - path = strings.Replace(path, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/backups/{backupId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + backupIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := Backup{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -2200,28 +2201,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - backupId := "backupId" + projectId := projectIdValue + backupId := backupIdValue resp, reqErr := apiClient.GetBackup(context.Background(), projectId, backupId).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService GetImage", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/images/{imageId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - imageIdValue := "imageId" - path = strings.Replace(path, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/images/{imageId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + imageIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -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 := Image{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -2255,28 +2256,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - imageId := "imageId" + projectId := projectIdValue + imageId := imageIdValue resp, reqErr := apiClient.GetImage(context.Background(), projectId, imageId).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 GetImageShare", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/images/{imageId}/share" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - imageIdValue := "imageId" - path = strings.Replace(path, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/images/{imageId}/share" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + imageIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -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 := ImageShare{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -2310,30 +2311,30 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - imageId := "imageId" + projectId := projectIdValue + imageId := imageIdValue resp, reqErr := apiClient.GetImageShare(context.Background(), projectId, imageId).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 GetImageShareConsumer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - imageIdValue := "imageId" - path = strings.Replace(path, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) - consumerProjectIdValue := "consumerProjectId" - path = strings.Replace(path, "{"+"consumerProjectId"+"}", url.PathEscape(ParameterValueToString(consumerProjectIdValue, "consumerProjectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + imageIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) + consumerProjectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"consumerProjectId"+"}", url.PathEscape(ParameterValueToString(consumerProjectIdValue, "consumerProjectId")), -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 := ImageShareConsumer{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -2367,27 +2368,27 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - imageId := "imageId" - consumerProjectId := "consumerProjectId" + projectId := projectIdValue + imageId := imageIdValue + consumerProjectId := consumerProjectIdValue resp, reqErr := apiClient.GetImageShareConsumer(context.Background(), projectId, imageId, consumerProjectId).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 GetKeyPair", func(t *testing.T) { - path := "/v1beta1/keypairs/{keypairName}" + _apiUrlPath := "/v1beta1/keypairs/{keypairName}" keypairNameValue := "keypairName" - path = strings.Replace(path, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -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 := Keypair{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -2421,27 +2422,27 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - keypairName := "keypairName" + keypairName := keypairNameValue resp, reqErr := apiClient.GetKeyPair(context.Background(), keypairName).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 GetMachineType", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/machine-types/{machineType}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/machine-types/{machineType}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) machineTypeValue := "machineType" - path = strings.Replace(path, "{"+"machineType"+"}", url.PathEscape(ParameterValueToString(machineTypeValue, "machineType")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"machineType"+"}", url.PathEscape(ParameterValueToString(machineTypeValue, "machineType")), -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 := MachineType{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -2475,28 +2476,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - machineType := "machineType" + projectId := projectIdValue + machineType := machineTypeValue resp, reqErr := apiClient.GetMachineType(context.Background(), projectId, machineType).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 GetNetwork", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/networks/{networkId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/networks/{networkId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + networkIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -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 := Network{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -2530,28 +2531,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - networkId := "networkId" + projectId := projectIdValue + networkId := networkIdValue resp, reqErr := apiClient.GetNetwork(context.Background(), projectId, networkId).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 GetNetworkArea", func(t *testing.T) { - path := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - areaIdValue := "areaId" - path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + _apiUrlPath := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}" + organizationIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -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 := NetworkArea{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -2585,30 +2586,30 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" - areaId := "areaId" + organizationId := organizationIdValue + areaId := areaIdValue resp, reqErr := apiClient.GetNetworkArea(context.Background(), organizationId, areaId).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 GetNetworkAreaRange", func(t *testing.T) { - path := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - areaIdValue := "areaId" - path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) - networkRangeIdValue := "networkRangeId" - path = strings.Replace(path, "{"+"networkRangeId"+"}", url.PathEscape(ParameterValueToString(networkRangeIdValue, "networkRangeId")), -1) + _apiUrlPath := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}" + organizationIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + networkRangeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkRangeId"+"}", url.PathEscape(ParameterValueToString(networkRangeIdValue, "networkRangeId")), -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 := NetworkRange{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -2642,31 +2643,31 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" - areaId := "areaId" - networkRangeId := "networkRangeId" + organizationId := organizationIdValue + areaId := areaIdValue + networkRangeId := networkRangeIdValue resp, reqErr := apiClient.GetNetworkAreaRange(context.Background(), organizationId, areaId, networkRangeId).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 GetNetworkAreaRoute", func(t *testing.T) { - path := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - areaIdValue := "areaId" - path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) - routeIdValue := "routeId" - path = strings.Replace(path, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(routeIdValue, "routeId")), -1) + _apiUrlPath := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + organizationIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + routeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(routeIdValue, "routeId")), -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 := Route{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -2700,31 +2701,31 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" - areaId := "areaId" - routeId := "routeId" + organizationId := organizationIdValue + areaId := areaIdValue + routeId := routeIdValue resp, reqErr := apiClient.GetNetworkAreaRoute(context.Background(), organizationId, areaId, routeId).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 GetNic", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/networks/{networkId}/nics/{nicId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) - nicIdValue := "nicId" - path = strings.Replace(path, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + networkIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + nicIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -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 := NIC{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -2758,29 +2759,29 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - networkId := "networkId" - nicId := "nicId" + projectId := projectIdValue + networkId := networkIdValue + nicId := nicIdValue resp, reqErr := apiClient.GetNic(context.Background(), projectId, networkId, nicId).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 GetOrganizationRequest", func(t *testing.T) { - path := "/v1beta1/organizations/{organizationId}/requests/{requestId}" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + _apiUrlPath := "/v1beta1/organizations/{organizationId}/requests/{requestId}" + organizationIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) requestIdValue := "requestId" - path = strings.Replace(path, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(requestIdValue, "requestId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(requestIdValue, "requestId")), -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 := Request{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -2814,28 +2815,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" - requestId := "requestId" + organizationId := organizationIdValue + requestId := requestIdValue resp, reqErr := apiClient.GetOrganizationRequest(context.Background(), organizationId, requestId).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 GetProjectNIC", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/nics/{nicId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - nicIdValue := "nicId" - path = strings.Replace(path, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/nics/{nicId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + nicIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -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 := NIC{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -2869,28 +2870,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - nicId := "nicId" + projectId := projectIdValue + nicId := nicIdValue resp, reqErr := apiClient.GetProjectNIC(context.Background(), projectId, nicId).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 GetProjectRequest", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/requests/{requestId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/requests/{requestId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) requestIdValue := "requestId" - path = strings.Replace(path, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(requestIdValue, "requestId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"requestId"+"}", url.PathEscape(ParameterValueToString(requestIdValue, "requestId")), -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 := Request{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -2924,28 +2925,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - requestId := "requestId" + projectId := projectIdValue + requestId := requestIdValue resp, reqErr := apiClient.GetProjectRequest(context.Background(), projectId, requestId).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 GetPublicIP", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/public-ips/{publicIpId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - publicIpIdValue := "publicIpId" - path = strings.Replace(path, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/public-ips/{publicIpId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + publicIpIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -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 := PublicIp{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -2979,28 +2980,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - publicIpId := "publicIpId" + projectId := projectIdValue + publicIpId := publicIpIdValue resp, reqErr := apiClient.GetPublicIP(context.Background(), projectId, publicIpId).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 GetSecurityGroup", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/security-groups/{securityGroupId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - securityGroupIdValue := "securityGroupId" - path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/security-groups/{securityGroupId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + securityGroupIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -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 := SecurityGroup{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -3034,30 +3035,30 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - securityGroupId := "securityGroupId" + projectId := projectIdValue + securityGroupId := securityGroupIdValue resp, reqErr := apiClient.GetSecurityGroup(context.Background(), projectId, securityGroupId).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 GetSecurityGroupRule", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - securityGroupIdValue := "securityGroupId" - path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) - securityGroupRuleIdValue := "securityGroupRuleId" - path = strings.Replace(path, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(securityGroupRuleIdValue, "securityGroupRuleId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + securityGroupIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) + securityGroupRuleIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(ParameterValueToString(securityGroupRuleIdValue, "securityGroupRuleId")), -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 := SecurityGroupRule{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -3091,29 +3092,29 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - securityGroupId := "securityGroupId" - securityGroupRuleId := "securityGroupRuleId" + projectId := projectIdValue + securityGroupId := securityGroupIdValue + securityGroupRuleId := securityGroupRuleIdValue resp, reqErr := apiClient.GetSecurityGroupRule(context.Background(), projectId, securityGroupId, securityGroupRuleId).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 GetServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -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 := Server{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -3147,28 +3148,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue resp, reqErr := apiClient.GetServer(context.Background(), projectId, serverId).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 GetServerConsole", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/console" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/console" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -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 := ServerConsoleUrl{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -3202,28 +3203,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue resp, reqErr := apiClient.GetServerConsole(context.Background(), projectId, serverId).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 GetServerLog", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/log" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/log" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -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 := GetServerLog200Response{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -3257,28 +3258,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue resp, reqErr := apiClient.GetServerLog(context.Background(), projectId, serverId).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 GetSnapshot", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/snapshots/{snapshotId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - snapshotIdValue := "snapshotId" - path = strings.Replace(path, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(snapshotIdValue, "snapshotId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/snapshots/{snapshotId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + snapshotIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(snapshotIdValue, "snapshotId")), -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 := Snapshot{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -3312,28 +3313,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - snapshotId := "snapshotId" + projectId := projectIdValue + snapshotId := snapshotIdValue resp, reqErr := apiClient.GetSnapshot(context.Background(), projectId, snapshotId).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 GetVolume", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/volumes/{volumeId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - volumeIdValue := "volumeId" - path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/volumes/{volumeId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + volumeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -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 := Volume{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -3367,28 +3368,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - volumeId := "volumeId" + projectId := projectIdValue + volumeId := volumeIdValue resp, reqErr := apiClient.GetVolume(context.Background(), projectId, volumeId).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 GetVolumePerformanceClass", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) volumePerformanceClassValue := "volumePerformanceClass" - path = strings.Replace(path, "{"+"volumePerformanceClass"+"}", url.PathEscape(ParameterValueToString(volumePerformanceClassValue, "volumePerformanceClass")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"volumePerformanceClass"+"}", url.PathEscape(ParameterValueToString(volumePerformanceClassValue, "volumePerformanceClass")), -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 := VolumePerformanceClass{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -3422,26 +3423,26 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - volumePerformanceClass := "volumePerformanceClass" + projectId := projectIdValue + volumePerformanceClass := volumePerformanceClassValue resp, reqErr := apiClient.GetVolumePerformanceClass(context.Background(), projectId, volumePerformanceClass).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 ListAffinityGroups", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/affinity-groups" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/affinity-groups" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := AffinityGroupListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -3475,27 +3476,27 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue resp, reqErr := apiClient.ListAffinityGroups(context.Background(), projectId).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 ListAttachedVolumes", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -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 := VolumeAttachmentListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -3529,24 +3530,24 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue resp, reqErr := apiClient.ListAttachedVolumes(context.Background(), projectId, serverId).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 ListAvailabilityZones", func(t *testing.T) { - path := "/v1beta1/availability-zones" + _apiUrlPath := "/v1beta1/availability-zones" testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := AvailabilityZoneListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -3585,18 +3586,18 @@ func Test_iaas_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 ListBackups", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/backups" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/backups" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := BackupListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -3630,25 +3631,25 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue resp, reqErr := apiClient.ListBackups(context.Background(), projectId).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 ListImages", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/images" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/images" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := ImageListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -3682,23 +3683,23 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue resp, reqErr := apiClient.ListImages(context.Background(), projectId).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 ListKeyPairs", func(t *testing.T) { - path := "/v1beta1/keypairs" + _apiUrlPath := "/v1beta1/keypairs" testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := KeyPairListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -3737,18 +3738,18 @@ func Test_iaas_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 ListMachineTypes", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/machine-types" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/machine-types" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := MachineTypeListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -3782,27 +3783,27 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue resp, reqErr := apiClient.ListMachineTypes(context.Background(), projectId).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 ListNetworkAreaProjects", func(t *testing.T) { - path := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/projects" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - areaIdValue := "areaId" - path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + _apiUrlPath := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/projects" + organizationIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -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 := ProjectListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -3836,28 +3837,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" - areaId := "areaId" + organizationId := organizationIdValue + areaId := areaIdValue resp, reqErr := apiClient.ListNetworkAreaProjects(context.Background(), organizationId, areaId).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 ListNetworkAreaRanges", func(t *testing.T) { - path := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - areaIdValue := "areaId" - path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + _apiUrlPath := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/network-ranges" + organizationIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -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 := NetworkRangeListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -3891,28 +3892,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" - areaId := "areaId" + organizationId := organizationIdValue + areaId := areaIdValue resp, reqErr := apiClient.ListNetworkAreaRanges(context.Background(), organizationId, areaId).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 ListNetworkAreaRoutes", func(t *testing.T) { - path := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - areaIdValue := "areaId" - path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + _apiUrlPath := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes" + organizationIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -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 := RouteListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -3946,26 +3947,26 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" - areaId := "areaId" + organizationId := organizationIdValue + areaId := areaIdValue resp, reqErr := apiClient.ListNetworkAreaRoutes(context.Background(), organizationId, areaId).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 ListNetworkAreas", func(t *testing.T) { - path := "/v1beta1/organizations/{organizationId}/network-areas" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + _apiUrlPath := "/v1beta1/organizations/{organizationId}/network-areas" + organizationIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -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 := NetworkAreaListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -3999,25 +4000,25 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" + organizationId := organizationIdValue resp, reqErr := apiClient.ListNetworkAreas(context.Background(), organizationId).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 ListNetworks", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/networks" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/networks" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := NetworkListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -4051,27 +4052,27 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue resp, reqErr := apiClient.ListNetworks(context.Background(), projectId).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 ListNics", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/networks/{networkId}/nics" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/networks/{networkId}/nics" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + networkIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -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 := NICListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -4105,26 +4106,26 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - networkId := "networkId" + projectId := projectIdValue + networkId := networkIdValue resp, reqErr := apiClient.ListNics(context.Background(), projectId, networkId).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 ListProjectNICs", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/nics" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/nics" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := NICListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -4158,25 +4159,25 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue resp, reqErr := apiClient.ListProjectNICs(context.Background(), projectId).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 ListPublicIPs", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/public-ips" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/public-ips" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := PublicIpListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -4210,23 +4211,23 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue resp, reqErr := apiClient.ListPublicIPs(context.Background(), projectId).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 ListPublicIpRanges", func(t *testing.T) { - path := "/v1beta1/networks/public-ip-ranges" + _apiUrlPath := "/v1beta1/networks/public-ip-ranges" testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := PublicNetworkListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -4265,18 +4266,18 @@ func Test_iaas_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 ListQuotas", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/quotas" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/quotas" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := QuotaListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -4310,27 +4311,27 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue resp, reqErr := apiClient.ListQuotas(context.Background(), projectId).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 ListSecurityGroupRules", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/security-groups/{securityGroupId}/rules" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - securityGroupIdValue := "securityGroupId" - path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/security-groups/{securityGroupId}/rules" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + securityGroupIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -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 := SecurityGroupRuleListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -4364,26 +4365,26 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - securityGroupId := "securityGroupId" + projectId := projectIdValue + securityGroupId := securityGroupIdValue resp, reqErr := apiClient.ListSecurityGroupRules(context.Background(), projectId, securityGroupId).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 ListSecurityGroups", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/security-groups" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/security-groups" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := SecurityGroupListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -4417,27 +4418,27 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue resp, reqErr := apiClient.ListSecurityGroups(context.Background(), projectId).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 ListServerNics", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/nics" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/nics" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -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 := NICListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -4471,28 +4472,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue resp, reqErr := apiClient.ListServerNics(context.Background(), projectId, serverId).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 ListServerServiceAccounts", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/service-accounts" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/service-accounts" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -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 := ServiceAccountMailListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -4526,26 +4527,26 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue resp, reqErr := apiClient.ListServerServiceAccounts(context.Background(), projectId, serverId).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 ListServers", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := ServerListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -4579,25 +4580,25 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue resp, reqErr := apiClient.ListServers(context.Background(), projectId).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 ListSnapshots", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/snapshots" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/snapshots" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := SnapshotListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -4631,25 +4632,25 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue resp, reqErr := apiClient.ListSnapshots(context.Background(), projectId).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 ListVolumePerformanceClasses", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/volume-performance-classes" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/volume-performance-classes" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := VolumePerformanceClassListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -4683,25 +4684,25 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue resp, reqErr := apiClient.ListVolumePerformanceClasses(context.Background(), projectId).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 ListVolumes", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/volumes" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/volumes" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -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 := VolumeListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -4735,27 +4736,27 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue resp, reqErr := apiClient.ListVolumes(context.Background(), projectId).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 PartialUpdateNetwork", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/networks/{networkId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/networks/{networkId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + networkIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -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() @@ -4786,8 +4787,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - networkId := "networkId" + projectId := projectIdValue + networkId := networkIdValue partialUpdateNetworkPayload := PartialUpdateNetworkPayload{} reqErr := apiClient.PartialUpdateNetwork(context.Background(), projectId, networkId).PartialUpdateNetworkPayload(partialUpdateNetworkPayload).Execute() @@ -4798,14 +4799,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService PartialUpdateNetworkArea", func(t *testing.T) { - path := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - areaIdValue := "areaId" - path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + _apiUrlPath := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}" + organizationIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -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 := NetworkArea{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -4839,8 +4840,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" - areaId := "areaId" + organizationId := organizationIdValue + areaId := areaIdValue partialUpdateNetworkAreaPayload := PartialUpdateNetworkAreaPayload{} resp, reqErr := apiClient.PartialUpdateNetworkArea(context.Background(), organizationId, areaId).PartialUpdateNetworkAreaPayload(partialUpdateNetworkAreaPayload).Execute() @@ -4848,20 +4849,20 @@ func Test_iaas_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 RebootServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/reboot" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/reboot" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -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() @@ -4892,8 +4893,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue reqErr := apiClient.RebootServer(context.Background(), projectId, serverId).Execute() @@ -4903,16 +4904,16 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService RemoveNetworkFromServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/networks/{networkId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/networks/{networkId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + networkIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -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() @@ -4943,9 +4944,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - networkId := "networkId" + projectId := projectIdValue + serverId := serverIdValue + networkId := networkIdValue reqErr := apiClient.RemoveNetworkFromServer(context.Background(), projectId, serverId, networkId).Execute() @@ -4955,16 +4956,16 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService RemoveNicFromServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/nics/{nicId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - nicIdValue := "nicId" - path = strings.Replace(path, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/nics/{nicId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + nicIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -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() @@ -4995,9 +4996,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - nicId := "nicId" + projectId := projectIdValue + serverId := serverIdValue + nicId := nicIdValue reqErr := apiClient.RemoveNicFromServer(context.Background(), projectId, serverId, nicId).Execute() @@ -5007,16 +5008,16 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService RemovePublicIpFromServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - publicIpIdValue := "publicIpId" - path = strings.Replace(path, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + publicIpIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -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() @@ -5047,9 +5048,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - publicIpId := "publicIpId" + projectId := projectIdValue + serverId := serverIdValue + publicIpId := publicIpIdValue reqErr := apiClient.RemovePublicIpFromServer(context.Background(), projectId, serverId, publicIpId).Execute() @@ -5059,16 +5060,16 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService RemoveSecurityGroupFromServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - securityGroupIdValue := "securityGroupId" - path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + securityGroupIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -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() @@ -5099,9 +5100,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - securityGroupId := "securityGroupId" + projectId := projectIdValue + serverId := serverIdValue + securityGroupId := securityGroupIdValue reqErr := apiClient.RemoveSecurityGroupFromServer(context.Background(), projectId, serverId, securityGroupId).Execute() @@ -5111,16 +5112,16 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService RemoveServiceAccountFromServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) serviceAccountMailValue := "serviceAccountMail" - path = strings.Replace(path, "{"+"serviceAccountMail"+"}", url.PathEscape(ParameterValueToString(serviceAccountMailValue, "serviceAccountMail")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceAccountMail"+"}", url.PathEscape(ParameterValueToString(serviceAccountMailValue, "serviceAccountMail")), -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 := ServiceAccountMailListResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -5154,31 +5155,31 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - serviceAccountMail := "serviceAccountMail" + projectId := projectIdValue + serverId := serverIdValue + serviceAccountMail := serviceAccountMailValue resp, reqErr := apiClient.RemoveServiceAccountFromServer(context.Background(), projectId, serverId, serviceAccountMail).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 RemoveVolumeFromServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - volumeIdValue := "volumeId" - path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + volumeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -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() @@ -5209,9 +5210,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - volumeId := "volumeId" + projectId := projectIdValue + serverId := serverIdValue + volumeId := volumeIdValue reqErr := apiClient.RemoveVolumeFromServer(context.Background(), projectId, serverId, volumeId).Execute() @@ -5221,14 +5222,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService RescueServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/rescue" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/rescue" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -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() @@ -5259,8 +5260,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue rescueServerPayload := RescueServerPayload{} reqErr := apiClient.RescueServer(context.Background(), projectId, serverId).RescueServerPayload(rescueServerPayload).Execute() @@ -5271,14 +5272,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ResizeServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/resize" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/resize" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -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() @@ -5309,8 +5310,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue resizeServerPayload := ResizeServerPayload{} reqErr := apiClient.ResizeServer(context.Background(), projectId, serverId).ResizeServerPayload(resizeServerPayload).Execute() @@ -5321,14 +5322,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService ResizeVolume", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/volumes/{volumeId}/resize" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - volumeIdValue := "volumeId" - path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/volumes/{volumeId}/resize" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + volumeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -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() @@ -5359,8 +5360,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - volumeId := "volumeId" + projectId := projectIdValue + volumeId := volumeIdValue reqErr := apiClient.ResizeVolume(context.Background(), projectId, volumeId).Execute() @@ -5370,14 +5371,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService RestoreBackup", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/backups/{backupId}/restore" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - backupIdValue := "backupId" - path = strings.Replace(path, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/backups/{backupId}/restore" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + backupIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -5408,8 +5409,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - backupId := "backupId" + projectId := projectIdValue + backupId := backupIdValue reqErr := apiClient.RestoreBackup(context.Background(), projectId, backupId).Execute() @@ -5419,14 +5420,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService SetImageShare", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/images/{imageId}/share" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - imageIdValue := "imageId" - path = strings.Replace(path, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/images/{imageId}/share" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + imageIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -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 := ImageShare{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -5460,8 +5461,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - imageId := "imageId" + projectId := projectIdValue + imageId := imageIdValue setImageSharePayload := SetImageSharePayload{} resp, reqErr := apiClient.SetImageShare(context.Background(), projectId, imageId).SetImageSharePayload(setImageSharePayload).Execute() @@ -5469,20 +5470,20 @@ func Test_iaas_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 StartServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/start" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/start" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -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() @@ -5513,8 +5514,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue reqErr := apiClient.StartServer(context.Background(), projectId, serverId).Execute() @@ -5524,14 +5525,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService StopServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/stop" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/stop" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -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() @@ -5562,8 +5563,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue reqErr := apiClient.StopServer(context.Background(), projectId, serverId).Execute() @@ -5573,14 +5574,14 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService UnrescueServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/unrescue" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/unrescue" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -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() @@ -5611,8 +5612,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue reqErr := apiClient.UnrescueServer(context.Background(), projectId, serverId).Execute() @@ -5622,16 +5623,16 @@ func Test_iaas_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService UpdateAttachedVolume", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) - volumeIdValue := "volumeId" - path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + volumeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -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 := VolumeAttachment{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -5665,9 +5666,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" - volumeId := "volumeId" + projectId := projectIdValue + serverId := serverIdValue + volumeId := volumeIdValue updateAttachedVolumePayload := UpdateAttachedVolumePayload{} resp, reqErr := apiClient.UpdateAttachedVolume(context.Background(), projectId, serverId, volumeId).UpdateAttachedVolumePayload(updateAttachedVolumePayload).Execute() @@ -5675,20 +5676,20 @@ func Test_iaas_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 UpdateBackup", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/backups/{backupId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - backupIdValue := "backupId" - path = strings.Replace(path, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/backups/{backupId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + backupIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"backupId"+"}", url.PathEscape(ParameterValueToString(backupIdValue, "backupId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := Backup{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -5722,8 +5723,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - backupId := "backupId" + projectId := projectIdValue + backupId := backupIdValue updateBackupPayload := UpdateBackupPayload{} resp, reqErr := apiClient.UpdateBackup(context.Background(), projectId, backupId).UpdateBackupPayload(updateBackupPayload).Execute() @@ -5731,20 +5732,20 @@ func Test_iaas_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 UpdateImage", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/images/{imageId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - imageIdValue := "imageId" - path = strings.Replace(path, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/images/{imageId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + imageIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -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 := Image{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -5778,8 +5779,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - imageId := "imageId" + projectId := projectIdValue + imageId := imageIdValue updateImagePayload := UpdateImagePayload{} resp, reqErr := apiClient.UpdateImage(context.Background(), projectId, imageId).UpdateImagePayload(updateImagePayload).Execute() @@ -5787,20 +5788,20 @@ func Test_iaas_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 UpdateImageScopeLocal", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/images/{imageId}/publish" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - imageIdValue := "imageId" - path = strings.Replace(path, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/images/{imageId}/publish" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + imageIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -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 := Image{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -5834,28 +5835,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - imageId := "imageId" + projectId := projectIdValue + imageId := imageIdValue resp, reqErr := apiClient.UpdateImageScopeLocal(context.Background(), projectId, imageId).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 UpdateImageScopePublic", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/images/{imageId}/publish" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - imageIdValue := "imageId" - path = strings.Replace(path, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/images/{imageId}/publish" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + imageIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -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 := Image{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -5889,28 +5890,28 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - imageId := "imageId" + projectId := projectIdValue + imageId := imageIdValue resp, reqErr := apiClient.UpdateImageScopePublic(context.Background(), projectId, imageId).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 UpdateImageShare", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/images/{imageId}/share" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - imageIdValue := "imageId" - path = strings.Replace(path, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/images/{imageId}/share" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + imageIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"imageId"+"}", url.PathEscape(ParameterValueToString(imageIdValue, "imageId")), -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 := ImageShare{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -5944,8 +5945,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - imageId := "imageId" + projectId := projectIdValue + imageId := imageIdValue updateImageSharePayload := UpdateImageSharePayload{} resp, reqErr := apiClient.UpdateImageShare(context.Background(), projectId, imageId).UpdateImageSharePayload(updateImageSharePayload).Execute() @@ -5953,18 +5954,18 @@ func Test_iaas_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 UpdateKeyPair", func(t *testing.T) { - path := "/v1beta1/keypairs/{keypairName}" + _apiUrlPath := "/v1beta1/keypairs/{keypairName}" keypairNameValue := "keypairName" - path = strings.Replace(path, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"keypairName"+"}", url.PathEscape(ParameterValueToString(keypairNameValue, "keypairName")), -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 := Keypair{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -5998,7 +5999,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - keypairName := "keypairName" + keypairName := keypairNameValue updateKeyPairPayload := UpdateKeyPairPayload{} resp, reqErr := apiClient.UpdateKeyPair(context.Background(), keypairName).UpdateKeyPairPayload(updateKeyPairPayload).Execute() @@ -6006,22 +6007,22 @@ func Test_iaas_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 UpdateNetworkAreaRoute", func(t *testing.T) { - path := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" - organizationIdValue := "organizationId" - path = strings.Replace(path, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) - areaIdValue := "areaId" - path = strings.Replace(path, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) - routeIdValue := "routeId" - path = strings.Replace(path, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(routeIdValue, "routeId")), -1) + _apiUrlPath := "/v1beta1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + organizationIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"organizationId"+"}", url.PathEscape(ParameterValueToString(organizationIdValue, "organizationId")), -1) + areaIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"areaId"+"}", url.PathEscape(ParameterValueToString(areaIdValue, "areaId")), -1) + routeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"routeId"+"}", url.PathEscape(ParameterValueToString(routeIdValue, "routeId")), -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 := Route{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -6055,9 +6056,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - organizationId := "organizationId" - areaId := "areaId" - routeId := "routeId" + organizationId := organizationIdValue + areaId := areaIdValue + routeId := routeIdValue updateNetworkAreaRoutePayload := UpdateNetworkAreaRoutePayload{} resp, reqErr := apiClient.UpdateNetworkAreaRoute(context.Background(), organizationId, areaId, routeId).UpdateNetworkAreaRoutePayload(updateNetworkAreaRoutePayload).Execute() @@ -6065,22 +6066,22 @@ func Test_iaas_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 UpdateNic", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/networks/{networkId}/nics/{nicId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - networkIdValue := "networkId" - path = strings.Replace(path, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) - nicIdValue := "nicId" - path = strings.Replace(path, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + networkIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"networkId"+"}", url.PathEscape(ParameterValueToString(networkIdValue, "networkId")), -1) + nicIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"nicId"+"}", url.PathEscape(ParameterValueToString(nicIdValue, "nicId")), -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 := NIC{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -6114,9 +6115,9 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - networkId := "networkId" - nicId := "nicId" + projectId := projectIdValue + networkId := networkIdValue + nicId := nicIdValue updateNicPayload := UpdateNicPayload{} resp, reqErr := apiClient.UpdateNic(context.Background(), projectId, networkId, nicId).UpdateNicPayload(updateNicPayload).Execute() @@ -6124,20 +6125,20 @@ func Test_iaas_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 UpdatePublicIP", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/public-ips/{publicIpId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - publicIpIdValue := "publicIpId" - path = strings.Replace(path, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/public-ips/{publicIpId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + publicIpIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"publicIpId"+"}", url.PathEscape(ParameterValueToString(publicIpIdValue, "publicIpId")), -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 := PublicIp{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -6171,8 +6172,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - publicIpId := "publicIpId" + projectId := projectIdValue + publicIpId := publicIpIdValue updatePublicIPPayload := UpdatePublicIPPayload{} resp, reqErr := apiClient.UpdatePublicIP(context.Background(), projectId, publicIpId).UpdatePublicIPPayload(updatePublicIPPayload).Execute() @@ -6180,20 +6181,20 @@ func Test_iaas_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 UpdateSecurityGroup", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/security-groups/{securityGroupId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - securityGroupIdValue := "securityGroupId" - path = strings.Replace(path, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/security-groups/{securityGroupId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + securityGroupIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"securityGroupId"+"}", url.PathEscape(ParameterValueToString(securityGroupIdValue, "securityGroupId")), -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 := SecurityGroup{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -6227,8 +6228,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - securityGroupId := "securityGroupId" + projectId := projectIdValue + securityGroupId := securityGroupIdValue updateSecurityGroupPayload := UpdateSecurityGroupPayload{} resp, reqErr := apiClient.UpdateSecurityGroup(context.Background(), projectId, securityGroupId).UpdateSecurityGroupPayload(updateSecurityGroupPayload).Execute() @@ -6236,20 +6237,20 @@ func Test_iaas_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 UpdateServer", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/servers/{serverId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - serverIdValue := "serverId" - path = strings.Replace(path, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/servers/{serverId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + serverIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serverId"+"}", url.PathEscape(ParameterValueToString(serverIdValue, "serverId")), -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 := Server{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -6283,8 +6284,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - serverId := "serverId" + projectId := projectIdValue + serverId := serverIdValue updateServerPayload := UpdateServerPayload{} resp, reqErr := apiClient.UpdateServer(context.Background(), projectId, serverId).UpdateServerPayload(updateServerPayload).Execute() @@ -6292,20 +6293,20 @@ func Test_iaas_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 UpdateSnapshot", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/snapshots/{snapshotId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - snapshotIdValue := "snapshotId" - path = strings.Replace(path, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(snapshotIdValue, "snapshotId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/snapshots/{snapshotId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + snapshotIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"snapshotId"+"}", url.PathEscape(ParameterValueToString(snapshotIdValue, "snapshotId")), -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 := Snapshot{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -6339,8 +6340,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - snapshotId := "snapshotId" + projectId := projectIdValue + snapshotId := snapshotIdValue updateSnapshotPayload := UpdateSnapshotPayload{} resp, reqErr := apiClient.UpdateSnapshot(context.Background(), projectId, snapshotId).UpdateSnapshotPayload(updateSnapshotPayload).Execute() @@ -6348,20 +6349,20 @@ func Test_iaas_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 UpdateVolume", func(t *testing.T) { - path := "/v1beta1/projects/{projectId}/volumes/{volumeId}" - projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - volumeIdValue := "volumeId" - path = strings.Replace(path, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -1) + _apiUrlPath := "/v1beta1/projects/{projectId}/volumes/{volumeId}" + projectIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + volumeIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"volumeId"+"}", url.PathEscape(ParameterValueToString(volumeIdValue, "volumeId")), -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 := Volume{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -6395,8 +6396,8 @@ func Test_iaas_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - volumeId := "volumeId" + projectId := projectIdValue + volumeId := volumeIdValue updateVolumePayload := UpdateVolumePayload{} resp, reqErr := apiClient.UpdateVolume(context.Background(), projectId, volumeId).UpdateVolumePayload(updateVolumePayload).Execute() @@ -6404,7 +6405,7 @@ func Test_iaas_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/iaas/go.mod b/services/iaas/go.mod index 95cdd8fb9..088df514b 100644 --- a/services/iaas/go.mod +++ b/services/iaas/go.mod @@ -4,10 +4,8 @@ go 1.21 require ( github.com/google/go-cmp v0.7.0 + github.com/google/uuid v1.6.0 github.com/stackitcloud/stackit-sdk-go/core v0.16.0 ) -require ( - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect -) +require github.com/golang-jwt/jwt/v5 v5.2.1 // indirect diff --git a/services/iaas/model_add_volume_to_server_payload.go b/services/iaas/model_add_volume_to_server_payload.go index bc8ca90b7..bf3145955 100644 --- a/services/iaas/model_add_volume_to_server_payload.go +++ b/services/iaas/model_add_volume_to_server_payload.go @@ -17,14 +17,76 @@ import ( // checks if the AddVolumeToServerPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &AddVolumeToServerPayload{} +/* + types and functions for deleteOnTermination +*/ + +// isBoolean +type AddVolumeToServerPayloadgetDeleteOnTerminationAttributeType = *bool +type AddVolumeToServerPayloadgetDeleteOnTerminationArgType = bool +type AddVolumeToServerPayloadgetDeleteOnTerminationRetType = bool + +func getAddVolumeToServerPayloadgetDeleteOnTerminationAttributeTypeOk(arg AddVolumeToServerPayloadgetDeleteOnTerminationAttributeType) (ret AddVolumeToServerPayloadgetDeleteOnTerminationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAddVolumeToServerPayloadgetDeleteOnTerminationAttributeType(arg *AddVolumeToServerPayloadgetDeleteOnTerminationAttributeType, val AddVolumeToServerPayloadgetDeleteOnTerminationRetType) { + *arg = &val +} + +/* + types and functions for serverId +*/ + +// isNotNullableString +type AddVolumeToServerPayloadGetServerIdAttributeType = *string + +func getAddVolumeToServerPayloadGetServerIdAttributeTypeOk(arg AddVolumeToServerPayloadGetServerIdAttributeType) (ret AddVolumeToServerPayloadGetServerIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAddVolumeToServerPayloadGetServerIdAttributeType(arg *AddVolumeToServerPayloadGetServerIdAttributeType, val AddVolumeToServerPayloadGetServerIdRetType) { + *arg = &val +} + +type AddVolumeToServerPayloadGetServerIdArgType = string +type AddVolumeToServerPayloadGetServerIdRetType = string + +/* + types and functions for volumeId +*/ + +// isNotNullableString +type AddVolumeToServerPayloadGetVolumeIdAttributeType = *string + +func getAddVolumeToServerPayloadGetVolumeIdAttributeTypeOk(arg AddVolumeToServerPayloadGetVolumeIdAttributeType) (ret AddVolumeToServerPayloadGetVolumeIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAddVolumeToServerPayloadGetVolumeIdAttributeType(arg *AddVolumeToServerPayloadGetVolumeIdAttributeType, val AddVolumeToServerPayloadGetVolumeIdRetType) { + *arg = &val +} + +type AddVolumeToServerPayloadGetVolumeIdArgType = string +type AddVolumeToServerPayloadGetVolumeIdRetType = string + // AddVolumeToServerPayload Object that represents a Volume attachment to a server. type AddVolumeToServerPayload struct { // Delete the volume during the termination of the server. Defaults to false. - DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` + DeleteOnTermination AddVolumeToServerPayloadgetDeleteOnTerminationAttributeType `json:"deleteOnTermination,omitempty"` // Universally Unique Identifier (UUID). - ServerId *string `json:"serverId,omitempty"` + ServerId AddVolumeToServerPayloadGetServerIdAttributeType `json:"serverId,omitempty"` // Universally Unique Identifier (UUID). - VolumeId *string `json:"volumeId,omitempty"` + VolumeId AddVolumeToServerPayloadGetVolumeIdAttributeType `json:"volumeId,omitempty"` } // NewAddVolumeToServerPayload instantiates a new AddVolumeToServerPayload object @@ -45,111 +107,84 @@ func NewAddVolumeToServerPayloadWithDefaults() *AddVolumeToServerPayload { } // GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. -func (o *AddVolumeToServerPayload) GetDeleteOnTermination() *bool { - if o == nil || IsNil(o.DeleteOnTermination) { - var ret *bool - return ret - } - return o.DeleteOnTermination +func (o *AddVolumeToServerPayload) GetDeleteOnTermination() (res AddVolumeToServerPayloadgetDeleteOnTerminationRetType) { + res, _ = o.GetDeleteOnTerminationOk() + return } // GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AddVolumeToServerPayload) GetDeleteOnTerminationOk() (*bool, bool) { - if o == nil || IsNil(o.DeleteOnTermination) { - return nil, false - } - return o.DeleteOnTermination, true +func (o *AddVolumeToServerPayload) GetDeleteOnTerminationOk() (ret AddVolumeToServerPayloadgetDeleteOnTerminationRetType, ok bool) { + return getAddVolumeToServerPayloadgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination) } // HasDeleteOnTermination returns a boolean if a field has been set. func (o *AddVolumeToServerPayload) HasDeleteOnTermination() bool { - if o != nil && !IsNil(o.DeleteOnTermination) { - return true - } - - return false + _, ok := o.GetDeleteOnTerminationOk() + return ok } // SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. -func (o *AddVolumeToServerPayload) SetDeleteOnTermination(v *bool) { - o.DeleteOnTermination = v +func (o *AddVolumeToServerPayload) SetDeleteOnTermination(v AddVolumeToServerPayloadgetDeleteOnTerminationRetType) { + setAddVolumeToServerPayloadgetDeleteOnTerminationAttributeType(&o.DeleteOnTermination, v) } // GetServerId returns the ServerId field value if set, zero value otherwise. -func (o *AddVolumeToServerPayload) GetServerId() *string { - if o == nil || IsNil(o.ServerId) { - var ret *string - return ret - } - return o.ServerId +func (o *AddVolumeToServerPayload) GetServerId() (res AddVolumeToServerPayloadGetServerIdRetType) { + res, _ = o.GetServerIdOk() + return } // GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AddVolumeToServerPayload) GetServerIdOk() (*string, bool) { - if o == nil || IsNil(o.ServerId) { - return nil, false - } - return o.ServerId, true +func (o *AddVolumeToServerPayload) GetServerIdOk() (ret AddVolumeToServerPayloadGetServerIdRetType, ok bool) { + return getAddVolumeToServerPayloadGetServerIdAttributeTypeOk(o.ServerId) } // HasServerId returns a boolean if a field has been set. func (o *AddVolumeToServerPayload) HasServerId() bool { - if o != nil && !IsNil(o.ServerId) { - return true - } - - return false + _, ok := o.GetServerIdOk() + return ok } // SetServerId gets a reference to the given string and assigns it to the ServerId field. -func (o *AddVolumeToServerPayload) SetServerId(v *string) { - o.ServerId = v +func (o *AddVolumeToServerPayload) SetServerId(v AddVolumeToServerPayloadGetServerIdRetType) { + setAddVolumeToServerPayloadGetServerIdAttributeType(&o.ServerId, v) } // GetVolumeId returns the VolumeId field value if set, zero value otherwise. -func (o *AddVolumeToServerPayload) GetVolumeId() *string { - if o == nil || IsNil(o.VolumeId) { - var ret *string - return ret - } - return o.VolumeId +func (o *AddVolumeToServerPayload) GetVolumeId() (res AddVolumeToServerPayloadGetVolumeIdRetType) { + res, _ = o.GetVolumeIdOk() + return } // GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AddVolumeToServerPayload) GetVolumeIdOk() (*string, bool) { - if o == nil || IsNil(o.VolumeId) { - return nil, false - } - return o.VolumeId, true +func (o *AddVolumeToServerPayload) GetVolumeIdOk() (ret AddVolumeToServerPayloadGetVolumeIdRetType, ok bool) { + return getAddVolumeToServerPayloadGetVolumeIdAttributeTypeOk(o.VolumeId) } // HasVolumeId returns a boolean if a field has been set. func (o *AddVolumeToServerPayload) HasVolumeId() bool { - if o != nil && !IsNil(o.VolumeId) { - return true - } - - return false + _, ok := o.GetVolumeIdOk() + return ok } // SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. -func (o *AddVolumeToServerPayload) SetVolumeId(v *string) { - o.VolumeId = v +func (o *AddVolumeToServerPayload) SetVolumeId(v AddVolumeToServerPayloadGetVolumeIdRetType) { + setAddVolumeToServerPayloadGetVolumeIdAttributeType(&o.VolumeId, v) } func (o AddVolumeToServerPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.DeleteOnTermination) { - toSerialize["deleteOnTermination"] = o.DeleteOnTermination + if val, ok := getAddVolumeToServerPayloadgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination); ok { + toSerialize["DeleteOnTermination"] = val } - if !IsNil(o.ServerId) { - toSerialize["serverId"] = o.ServerId + if val, ok := getAddVolumeToServerPayloadGetServerIdAttributeTypeOk(o.ServerId); ok { + toSerialize["ServerId"] = val } - if !IsNil(o.VolumeId) { - toSerialize["volumeId"] = o.VolumeId + if val, ok := getAddVolumeToServerPayloadGetVolumeIdAttributeTypeOk(o.VolumeId); ok { + toSerialize["VolumeId"] = val } return toSerialize, nil } diff --git a/services/iaas/model_affinity_group.go b/services/iaas/model_affinity_group.go index 944aef774..b0906fa53 100644 --- a/services/iaas/model_affinity_group.go +++ b/services/iaas/model_affinity_group.go @@ -17,18 +17,101 @@ import ( // checks if the AffinityGroup type satisfies the MappedNullable interface at compile time var _ MappedNullable = &AffinityGroup{} +/* + types and functions for id +*/ + +// isNotNullableString +type AffinityGroupGetIdAttributeType = *string + +func getAffinityGroupGetIdAttributeTypeOk(arg AffinityGroupGetIdAttributeType) (ret AffinityGroupGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAffinityGroupGetIdAttributeType(arg *AffinityGroupGetIdAttributeType, val AffinityGroupGetIdRetType) { + *arg = &val +} + +type AffinityGroupGetIdArgType = string +type AffinityGroupGetIdRetType = string + +/* + types and functions for members +*/ + +// isArray +type AffinityGroupGetMembersAttributeType = *[]string +type AffinityGroupGetMembersArgType = []string +type AffinityGroupGetMembersRetType = []string + +func getAffinityGroupGetMembersAttributeTypeOk(arg AffinityGroupGetMembersAttributeType) (ret AffinityGroupGetMembersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAffinityGroupGetMembersAttributeType(arg *AffinityGroupGetMembersAttributeType, val AffinityGroupGetMembersRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type AffinityGroupGetNameAttributeType = *string + +func getAffinityGroupGetNameAttributeTypeOk(arg AffinityGroupGetNameAttributeType) (ret AffinityGroupGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAffinityGroupGetNameAttributeType(arg *AffinityGroupGetNameAttributeType, val AffinityGroupGetNameRetType) { + *arg = &val +} + +type AffinityGroupGetNameArgType = string +type AffinityGroupGetNameRetType = string + +/* + types and functions for policy +*/ + +// isNotNullableString +type AffinityGroupGetPolicyAttributeType = *string + +func getAffinityGroupGetPolicyAttributeTypeOk(arg AffinityGroupGetPolicyAttributeType) (ret AffinityGroupGetPolicyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAffinityGroupGetPolicyAttributeType(arg *AffinityGroupGetPolicyAttributeType, val AffinityGroupGetPolicyRetType) { + *arg = &val +} + +type AffinityGroupGetPolicyArgType = string +type AffinityGroupGetPolicyRetType = string + // AffinityGroup Definition of an affinity group. type AffinityGroup struct { // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id AffinityGroupGetIdAttributeType `json:"id,omitempty"` // The servers that are part of the affinity group. - Members *[]string `json:"members,omitempty"` + Members AffinityGroupGetMembersAttributeType `json:"members,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED - Name *string `json:"name"` + Name AffinityGroupGetNameAttributeType `json:"name"` // The affinity group policy. `hard-affinity`: All servers in this group will be hosted on the same compute node. `soft-affinity`: All servers in this group will be hosted on as few compute nodes as possible. `hard-anti-affinity`: All servers in this group will be hosted on different compute nodes. `soft-anti-affinity`: All servers in this group will be hosted on as many compute nodes as possible. Possible values: `hard-anti-affinity`, `hard-affinity`, `soft-anti-affinity`, `soft-affinity`. // REQUIRED - Policy *string `json:"policy"` + Policy AffinityGroupGetPolicyAttributeType `json:"policy"` } type _AffinityGroup AffinityGroup @@ -37,10 +120,10 @@ type _AffinityGroup AffinityGroup // 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 NewAffinityGroup(name *string, policy *string) *AffinityGroup { +func NewAffinityGroup(name AffinityGroupGetNameArgType, policy AffinityGroupGetPolicyArgType) *AffinityGroup { this := AffinityGroup{} - this.Name = name - this.Policy = policy + setAffinityGroupGetNameAttributeType(&this.Name, name) + setAffinityGroupGetPolicyAttributeType(&this.Policy, policy) return &this } @@ -53,127 +136,99 @@ func NewAffinityGroupWithDefaults() *AffinityGroup { } // GetId returns the Id field value if set, zero value otherwise. -func (o *AffinityGroup) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *AffinityGroup) GetId() (res AffinityGroupGetIdRetType) { + 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 *AffinityGroup) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *AffinityGroup) GetIdOk() (ret AffinityGroupGetIdRetType, ok bool) { + return getAffinityGroupGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *AffinityGroup) 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 *AffinityGroup) SetId(v *string) { - o.Id = v +func (o *AffinityGroup) SetId(v AffinityGroupGetIdRetType) { + setAffinityGroupGetIdAttributeType(&o.Id, v) } // GetMembers returns the Members field value if set, zero value otherwise. -func (o *AffinityGroup) GetMembers() *[]string { - if o == nil || IsNil(o.Members) { - var ret *[]string - return ret - } - return o.Members +func (o *AffinityGroup) GetMembers() (res AffinityGroupGetMembersRetType) { + res, _ = o.GetMembersOk() + return } // GetMembersOk returns a tuple with the Members field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AffinityGroup) GetMembersOk() (*[]string, bool) { - if o == nil || IsNil(o.Members) { - return nil, false - } - return o.Members, true +func (o *AffinityGroup) GetMembersOk() (ret AffinityGroupGetMembersRetType, ok bool) { + return getAffinityGroupGetMembersAttributeTypeOk(o.Members) } // HasMembers returns a boolean if a field has been set. func (o *AffinityGroup) HasMembers() bool { - if o != nil && !IsNil(o.Members) { - return true - } - - return false + _, ok := o.GetMembersOk() + return ok } // SetMembers gets a reference to the given []string and assigns it to the Members field. -func (o *AffinityGroup) SetMembers(v *[]string) { - o.Members = v +func (o *AffinityGroup) SetMembers(v AffinityGroupGetMembersRetType) { + setAffinityGroupGetMembersAttributeType(&o.Members, v) } // GetName returns the Name field value -func (o *AffinityGroup) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *AffinityGroup) GetName() (ret AffinityGroupGetNameRetType) { + 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 *AffinityGroup) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *AffinityGroup) GetNameOk() (ret AffinityGroupGetNameRetType, ok bool) { + return getAffinityGroupGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *AffinityGroup) SetName(v *string) { - o.Name = v +func (o *AffinityGroup) SetName(v AffinityGroupGetNameRetType) { + setAffinityGroupGetNameAttributeType(&o.Name, v) } // GetPolicy returns the Policy field value -func (o *AffinityGroup) GetPolicy() *string { - if o == nil || IsNil(o.Policy) { - var ret *string - return ret - } - - return o.Policy +func (o *AffinityGroup) GetPolicy() (ret AffinityGroupGetPolicyRetType) { + ret, _ = o.GetPolicyOk() + return ret } // GetPolicyOk returns a tuple with the Policy field value // and a boolean to check if the value has been set. -func (o *AffinityGroup) GetPolicyOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Policy, true +func (o *AffinityGroup) GetPolicyOk() (ret AffinityGroupGetPolicyRetType, ok bool) { + return getAffinityGroupGetPolicyAttributeTypeOk(o.Policy) } // SetPolicy sets field value -func (o *AffinityGroup) SetPolicy(v *string) { - o.Policy = v +func (o *AffinityGroup) SetPolicy(v AffinityGroupGetPolicyRetType) { + setAffinityGroupGetPolicyAttributeType(&o.Policy, v) } func (o AffinityGroup) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getAffinityGroupGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getAffinityGroupGetMembersAttributeTypeOk(o.Members); ok { + toSerialize["Members"] = val + } + if val, ok := getAffinityGroupGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Members) { - toSerialize["members"] = o.Members + if val, ok := getAffinityGroupGetPolicyAttributeTypeOk(o.Policy); ok { + toSerialize["Policy"] = val } - toSerialize["name"] = o.Name - toSerialize["policy"] = o.Policy return toSerialize, nil } diff --git a/services/iaas/model_affinity_group_list_response.go b/services/iaas/model_affinity_group_list_response.go index d58d96ba8..d8c177dbc 100644 --- a/services/iaas/model_affinity_group_list_response.go +++ b/services/iaas/model_affinity_group_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the AffinityGroupListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &AffinityGroupListResponse{} +/* + types and functions for items +*/ + +// isArray +type AffinityGroupListResponseGetItemsAttributeType = *[]AffinityGroup +type AffinityGroupListResponseGetItemsArgType = []AffinityGroup +type AffinityGroupListResponseGetItemsRetType = []AffinityGroup + +func getAffinityGroupListResponseGetItemsAttributeTypeOk(arg AffinityGroupListResponseGetItemsAttributeType) (ret AffinityGroupListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAffinityGroupListResponseGetItemsAttributeType(arg *AffinityGroupListResponseGetItemsAttributeType, val AffinityGroupListResponseGetItemsRetType) { + *arg = &val +} + // AffinityGroupListResponse Response object for affinity group list request. type AffinityGroupListResponse struct { // A list of affinity groups. // REQUIRED - Items *[]AffinityGroup `json:"items"` + Items AffinityGroupListResponseGetItemsAttributeType `json:"items"` } type _AffinityGroupListResponse AffinityGroupListResponse @@ -30,9 +50,9 @@ type _AffinityGroupListResponse AffinityGroupListResponse // 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 NewAffinityGroupListResponse(items *[]AffinityGroup) *AffinityGroupListResponse { +func NewAffinityGroupListResponse(items AffinityGroupListResponseGetItemsArgType) *AffinityGroupListResponse { this := AffinityGroupListResponse{} - this.Items = items + setAffinityGroupListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewAffinityGroupListResponseWithDefaults() *AffinityGroupListResponse { } // GetItems returns the Items field value -func (o *AffinityGroupListResponse) GetItems() *[]AffinityGroup { - if o == nil || IsNil(o.Items) { - var ret *[]AffinityGroup - return ret - } - - return o.Items +func (o *AffinityGroupListResponse) GetItems() (ret AffinityGroupListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *AffinityGroupListResponse) GetItemsOk() (*[]AffinityGroup, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *AffinityGroupListResponse) GetItemsOk() (ret AffinityGroupListResponseGetItemsRetType, ok bool) { + return getAffinityGroupListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *AffinityGroupListResponse) SetItems(v *[]AffinityGroup) { - o.Items = v +func (o *AffinityGroupListResponse) SetItems(v AffinityGroupListResponseGetItemsRetType) { + setAffinityGroupListResponseGetItemsAttributeType(&o.Items, v) } func (o AffinityGroupListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getAffinityGroupListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_area.go b/services/iaas/model_area.go index 2f1acd941..8bf723131 100644 --- a/services/iaas/model_area.go +++ b/services/iaas/model_area.go @@ -17,16 +17,97 @@ import ( // checks if the Area type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Area{} +/* + types and functions for defaultNameservers +*/ + +// isArray +type AreaGetDefaultNameserversAttributeType = *[]string +type AreaGetDefaultNameserversArgType = []string +type AreaGetDefaultNameserversRetType = []string + +func getAreaGetDefaultNameserversAttributeTypeOk(arg AreaGetDefaultNameserversAttributeType) (ret AreaGetDefaultNameserversRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAreaGetDefaultNameserversAttributeType(arg *AreaGetDefaultNameserversAttributeType, val AreaGetDefaultNameserversRetType) { + *arg = &val +} + +/* + types and functions for networkRanges +*/ + +// isArray +type AreaGetNetworkRangesAttributeType = *[]NetworkRange +type AreaGetNetworkRangesArgType = []NetworkRange +type AreaGetNetworkRangesRetType = []NetworkRange + +func getAreaGetNetworkRangesAttributeTypeOk(arg AreaGetNetworkRangesAttributeType) (ret AreaGetNetworkRangesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAreaGetNetworkRangesAttributeType(arg *AreaGetNetworkRangesAttributeType, val AreaGetNetworkRangesRetType) { + *arg = &val +} + +/* + types and functions for routes +*/ + +// isArray +type AreaGetRoutesAttributeType = *[]Route +type AreaGetRoutesArgType = []Route +type AreaGetRoutesRetType = []Route + +func getAreaGetRoutesAttributeTypeOk(arg AreaGetRoutesAttributeType) (ret AreaGetRoutesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAreaGetRoutesAttributeType(arg *AreaGetRoutesAttributeType, val AreaGetRoutesRetType) { + *arg = &val +} + +/* + types and functions for transferNetwork +*/ + +// isNotNullableString +type AreaGetTransferNetworkAttributeType = *string + +func getAreaGetTransferNetworkAttributeTypeOk(arg AreaGetTransferNetworkAttributeType) (ret AreaGetTransferNetworkRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAreaGetTransferNetworkAttributeType(arg *AreaGetTransferNetworkAttributeType, val AreaGetTransferNetworkRetType) { + *arg = &val +} + +type AreaGetTransferNetworkArgType = string +type AreaGetTransferNetworkRetType = string + // Area The basic properties of a network area. type Area struct { // A list containing DNS Servers/Nameservers for IPv4. - DefaultNameservers *[]string `json:"defaultNameservers,omitempty"` + DefaultNameservers AreaGetDefaultNameserversAttributeType `json:"defaultNameservers,omitempty"` // A list of network ranges. - NetworkRanges *[]NetworkRange `json:"networkRanges,omitempty"` + NetworkRanges AreaGetNetworkRangesAttributeType `json:"networkRanges,omitempty"` // A list of routes. - Routes *[]Route `json:"routes,omitempty"` + Routes AreaGetRoutesAttributeType `json:"routes,omitempty"` // Classless Inter-Domain Routing (CIDR). - TransferNetwork *string `json:"transferNetwork,omitempty"` + TransferNetwork AreaGetTransferNetworkAttributeType `json:"transferNetwork,omitempty"` } // NewArea instantiates a new Area object @@ -47,146 +128,110 @@ func NewAreaWithDefaults() *Area { } // GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. -func (o *Area) GetDefaultNameservers() *[]string { - if o == nil || IsNil(o.DefaultNameservers) { - var ret *[]string - return ret - } - return o.DefaultNameservers +func (o *Area) GetDefaultNameservers() (res AreaGetDefaultNameserversRetType) { + res, _ = o.GetDefaultNameserversOk() + return } // GetDefaultNameserversOk returns a tuple with the DefaultNameservers field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Area) GetDefaultNameserversOk() (*[]string, bool) { - if o == nil || IsNil(o.DefaultNameservers) { - return nil, false - } - return o.DefaultNameservers, true +func (o *Area) GetDefaultNameserversOk() (ret AreaGetDefaultNameserversRetType, ok bool) { + return getAreaGetDefaultNameserversAttributeTypeOk(o.DefaultNameservers) } // HasDefaultNameservers returns a boolean if a field has been set. func (o *Area) HasDefaultNameservers() bool { - if o != nil && !IsNil(o.DefaultNameservers) { - return true - } - - return false + _, ok := o.GetDefaultNameserversOk() + return ok } // SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. -func (o *Area) SetDefaultNameservers(v *[]string) { - o.DefaultNameservers = v +func (o *Area) SetDefaultNameservers(v AreaGetDefaultNameserversRetType) { + setAreaGetDefaultNameserversAttributeType(&o.DefaultNameservers, v) } // GetNetworkRanges returns the NetworkRanges field value if set, zero value otherwise. -func (o *Area) GetNetworkRanges() *[]NetworkRange { - if o == nil || IsNil(o.NetworkRanges) { - var ret *[]NetworkRange - return ret - } - return o.NetworkRanges +func (o *Area) GetNetworkRanges() (res AreaGetNetworkRangesRetType) { + res, _ = o.GetNetworkRangesOk() + return } // GetNetworkRangesOk returns a tuple with the NetworkRanges field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Area) GetNetworkRangesOk() (*[]NetworkRange, bool) { - if o == nil || IsNil(o.NetworkRanges) { - return nil, false - } - return o.NetworkRanges, true +func (o *Area) GetNetworkRangesOk() (ret AreaGetNetworkRangesRetType, ok bool) { + return getAreaGetNetworkRangesAttributeTypeOk(o.NetworkRanges) } // HasNetworkRanges returns a boolean if a field has been set. func (o *Area) HasNetworkRanges() bool { - if o != nil && !IsNil(o.NetworkRanges) { - return true - } - - return false + _, ok := o.GetNetworkRangesOk() + return ok } // SetNetworkRanges gets a reference to the given []NetworkRange and assigns it to the NetworkRanges field. -func (o *Area) SetNetworkRanges(v *[]NetworkRange) { - o.NetworkRanges = v +func (o *Area) SetNetworkRanges(v AreaGetNetworkRangesRetType) { + setAreaGetNetworkRangesAttributeType(&o.NetworkRanges, v) } // GetRoutes returns the Routes field value if set, zero value otherwise. -func (o *Area) GetRoutes() *[]Route { - if o == nil || IsNil(o.Routes) { - var ret *[]Route - return ret - } - return o.Routes +func (o *Area) GetRoutes() (res AreaGetRoutesRetType) { + res, _ = o.GetRoutesOk() + return } // GetRoutesOk returns a tuple with the Routes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Area) GetRoutesOk() (*[]Route, bool) { - if o == nil || IsNil(o.Routes) { - return nil, false - } - return o.Routes, true +func (o *Area) GetRoutesOk() (ret AreaGetRoutesRetType, ok bool) { + return getAreaGetRoutesAttributeTypeOk(o.Routes) } // HasRoutes returns a boolean if a field has been set. func (o *Area) HasRoutes() bool { - if o != nil && !IsNil(o.Routes) { - return true - } - - return false + _, ok := o.GetRoutesOk() + return ok } // SetRoutes gets a reference to the given []Route and assigns it to the Routes field. -func (o *Area) SetRoutes(v *[]Route) { - o.Routes = v +func (o *Area) SetRoutes(v AreaGetRoutesRetType) { + setAreaGetRoutesAttributeType(&o.Routes, v) } // GetTransferNetwork returns the TransferNetwork field value if set, zero value otherwise. -func (o *Area) GetTransferNetwork() *string { - if o == nil || IsNil(o.TransferNetwork) { - var ret *string - return ret - } - return o.TransferNetwork +func (o *Area) GetTransferNetwork() (res AreaGetTransferNetworkRetType) { + res, _ = o.GetTransferNetworkOk() + return } // GetTransferNetworkOk returns a tuple with the TransferNetwork field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Area) GetTransferNetworkOk() (*string, bool) { - if o == nil || IsNil(o.TransferNetwork) { - return nil, false - } - return o.TransferNetwork, true +func (o *Area) GetTransferNetworkOk() (ret AreaGetTransferNetworkRetType, ok bool) { + return getAreaGetTransferNetworkAttributeTypeOk(o.TransferNetwork) } // HasTransferNetwork returns a boolean if a field has been set. func (o *Area) HasTransferNetwork() bool { - if o != nil && !IsNil(o.TransferNetwork) { - return true - } - - return false + _, ok := o.GetTransferNetworkOk() + return ok } // SetTransferNetwork gets a reference to the given string and assigns it to the TransferNetwork field. -func (o *Area) SetTransferNetwork(v *string) { - o.TransferNetwork = v +func (o *Area) SetTransferNetwork(v AreaGetTransferNetworkRetType) { + setAreaGetTransferNetworkAttributeType(&o.TransferNetwork, v) } func (o Area) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.DefaultNameservers) { - toSerialize["defaultNameservers"] = o.DefaultNameservers + if val, ok := getAreaGetDefaultNameserversAttributeTypeOk(o.DefaultNameservers); ok { + toSerialize["DefaultNameservers"] = val } - if !IsNil(o.NetworkRanges) { - toSerialize["networkRanges"] = o.NetworkRanges + if val, ok := getAreaGetNetworkRangesAttributeTypeOk(o.NetworkRanges); ok { + toSerialize["NetworkRanges"] = val } - if !IsNil(o.Routes) { - toSerialize["routes"] = o.Routes + if val, ok := getAreaGetRoutesAttributeTypeOk(o.Routes); ok { + toSerialize["Routes"] = val } - if !IsNil(o.TransferNetwork) { - toSerialize["transferNetwork"] = o.TransferNetwork + if val, ok := getAreaGetTransferNetworkAttributeTypeOk(o.TransferNetwork); ok { + toSerialize["TransferNetwork"] = val } return toSerialize, nil } diff --git a/services/iaas/model_area_config.go b/services/iaas/model_area_config.go index 5c39eca59..e080e34f0 100644 --- a/services/iaas/model_area_config.go +++ b/services/iaas/model_area_config.go @@ -17,17 +17,98 @@ import ( // checks if the AreaConfig type satisfies the MappedNullable interface at compile time var _ MappedNullable = &AreaConfig{} +/* + types and functions for defaultNameservers +*/ + +// isArray +type AreaConfigGetDefaultNameserversAttributeType = *[]string +type AreaConfigGetDefaultNameserversArgType = []string +type AreaConfigGetDefaultNameserversRetType = []string + +func getAreaConfigGetDefaultNameserversAttributeTypeOk(arg AreaConfigGetDefaultNameserversAttributeType) (ret AreaConfigGetDefaultNameserversRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAreaConfigGetDefaultNameserversAttributeType(arg *AreaConfigGetDefaultNameserversAttributeType, val AreaConfigGetDefaultNameserversRetType) { + *arg = &val +} + +/* + types and functions for networkRanges +*/ + +// isArray +type AreaConfigGetNetworkRangesAttributeType = *[]NetworkRange +type AreaConfigGetNetworkRangesArgType = []NetworkRange +type AreaConfigGetNetworkRangesRetType = []NetworkRange + +func getAreaConfigGetNetworkRangesAttributeTypeOk(arg AreaConfigGetNetworkRangesAttributeType) (ret AreaConfigGetNetworkRangesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAreaConfigGetNetworkRangesAttributeType(arg *AreaConfigGetNetworkRangesAttributeType, val AreaConfigGetNetworkRangesRetType) { + *arg = &val +} + +/* + types and functions for routes +*/ + +// isArray +type AreaConfigGetRoutesAttributeType = *[]Route +type AreaConfigGetRoutesArgType = []Route +type AreaConfigGetRoutesRetType = []Route + +func getAreaConfigGetRoutesAttributeTypeOk(arg AreaConfigGetRoutesAttributeType) (ret AreaConfigGetRoutesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAreaConfigGetRoutesAttributeType(arg *AreaConfigGetRoutesAttributeType, val AreaConfigGetRoutesRetType) { + *arg = &val +} + +/* + types and functions for transferNetwork +*/ + +// isNotNullableString +type AreaConfigGetTransferNetworkAttributeType = *string + +func getAreaConfigGetTransferNetworkAttributeTypeOk(arg AreaConfigGetTransferNetworkAttributeType) (ret AreaConfigGetTransferNetworkRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAreaConfigGetTransferNetworkAttributeType(arg *AreaConfigGetTransferNetworkAttributeType, val AreaConfigGetTransferNetworkRetType) { + *arg = &val +} + +type AreaConfigGetTransferNetworkArgType = string +type AreaConfigGetTransferNetworkRetType = string + // AreaConfig The basic network area object. type AreaConfig struct { - DefaultNameservers *[]string `json:"defaultNameservers,omitempty"` + DefaultNameservers AreaConfigGetDefaultNameserversAttributeType `json:"defaultNameservers,omitempty"` // A list of network ranges. // REQUIRED - NetworkRanges *[]NetworkRange `json:"networkRanges"` + NetworkRanges AreaConfigGetNetworkRangesAttributeType `json:"networkRanges"` // A list of routes. - Routes *[]Route `json:"routes,omitempty"` + Routes AreaConfigGetRoutesAttributeType `json:"routes,omitempty"` // Classless Inter-Domain Routing (CIDR). // REQUIRED - TransferNetwork *string `json:"transferNetwork"` + TransferNetwork AreaConfigGetTransferNetworkAttributeType `json:"transferNetwork"` } type _AreaConfig AreaConfig @@ -36,10 +117,10 @@ type _AreaConfig AreaConfig // 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 NewAreaConfig(networkRanges *[]NetworkRange, transferNetwork *string) *AreaConfig { +func NewAreaConfig(networkRanges AreaConfigGetNetworkRangesArgType, transferNetwork AreaConfigGetTransferNetworkArgType) *AreaConfig { this := AreaConfig{} - this.NetworkRanges = networkRanges - this.TransferNetwork = transferNetwork + setAreaConfigGetNetworkRangesAttributeType(&this.NetworkRanges, networkRanges) + setAreaConfigGetTransferNetworkAttributeType(&this.TransferNetwork, transferNetwork) return &this } @@ -52,127 +133,99 @@ func NewAreaConfigWithDefaults() *AreaConfig { } // GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. -func (o *AreaConfig) GetDefaultNameservers() *[]string { - if o == nil || IsNil(o.DefaultNameservers) { - var ret *[]string - return ret - } - return o.DefaultNameservers +func (o *AreaConfig) GetDefaultNameservers() (res AreaConfigGetDefaultNameserversRetType) { + res, _ = o.GetDefaultNameserversOk() + return } // GetDefaultNameserversOk returns a tuple with the DefaultNameservers field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AreaConfig) GetDefaultNameserversOk() (*[]string, bool) { - if o == nil || IsNil(o.DefaultNameservers) { - return nil, false - } - return o.DefaultNameservers, true +func (o *AreaConfig) GetDefaultNameserversOk() (ret AreaConfigGetDefaultNameserversRetType, ok bool) { + return getAreaConfigGetDefaultNameserversAttributeTypeOk(o.DefaultNameservers) } // HasDefaultNameservers returns a boolean if a field has been set. func (o *AreaConfig) HasDefaultNameservers() bool { - if o != nil && !IsNil(o.DefaultNameservers) { - return true - } - - return false + _, ok := o.GetDefaultNameserversOk() + return ok } // SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. -func (o *AreaConfig) SetDefaultNameservers(v *[]string) { - o.DefaultNameservers = v +func (o *AreaConfig) SetDefaultNameservers(v AreaConfigGetDefaultNameserversRetType) { + setAreaConfigGetDefaultNameserversAttributeType(&o.DefaultNameservers, v) } // GetNetworkRanges returns the NetworkRanges field value -func (o *AreaConfig) GetNetworkRanges() *[]NetworkRange { - if o == nil || IsNil(o.NetworkRanges) { - var ret *[]NetworkRange - return ret - } - - return o.NetworkRanges +func (o *AreaConfig) GetNetworkRanges() (ret AreaConfigGetNetworkRangesRetType) { + ret, _ = o.GetNetworkRangesOk() + return ret } // GetNetworkRangesOk returns a tuple with the NetworkRanges field value // and a boolean to check if the value has been set. -func (o *AreaConfig) GetNetworkRangesOk() (*[]NetworkRange, bool) { - if o == nil { - return nil, false - } - return o.NetworkRanges, true +func (o *AreaConfig) GetNetworkRangesOk() (ret AreaConfigGetNetworkRangesRetType, ok bool) { + return getAreaConfigGetNetworkRangesAttributeTypeOk(o.NetworkRanges) } // SetNetworkRanges sets field value -func (o *AreaConfig) SetNetworkRanges(v *[]NetworkRange) { - o.NetworkRanges = v +func (o *AreaConfig) SetNetworkRanges(v AreaConfigGetNetworkRangesRetType) { + setAreaConfigGetNetworkRangesAttributeType(&o.NetworkRanges, v) } // GetRoutes returns the Routes field value if set, zero value otherwise. -func (o *AreaConfig) GetRoutes() *[]Route { - if o == nil || IsNil(o.Routes) { - var ret *[]Route - return ret - } - return o.Routes +func (o *AreaConfig) GetRoutes() (res AreaConfigGetRoutesRetType) { + res, _ = o.GetRoutesOk() + return } // GetRoutesOk returns a tuple with the Routes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AreaConfig) GetRoutesOk() (*[]Route, bool) { - if o == nil || IsNil(o.Routes) { - return nil, false - } - return o.Routes, true +func (o *AreaConfig) GetRoutesOk() (ret AreaConfigGetRoutesRetType, ok bool) { + return getAreaConfigGetRoutesAttributeTypeOk(o.Routes) } // HasRoutes returns a boolean if a field has been set. func (o *AreaConfig) HasRoutes() bool { - if o != nil && !IsNil(o.Routes) { - return true - } - - return false + _, ok := o.GetRoutesOk() + return ok } // SetRoutes gets a reference to the given []Route and assigns it to the Routes field. -func (o *AreaConfig) SetRoutes(v *[]Route) { - o.Routes = v +func (o *AreaConfig) SetRoutes(v AreaConfigGetRoutesRetType) { + setAreaConfigGetRoutesAttributeType(&o.Routes, v) } // GetTransferNetwork returns the TransferNetwork field value -func (o *AreaConfig) GetTransferNetwork() *string { - if o == nil || IsNil(o.TransferNetwork) { - var ret *string - return ret - } - - return o.TransferNetwork +func (o *AreaConfig) GetTransferNetwork() (ret AreaConfigGetTransferNetworkRetType) { + ret, _ = o.GetTransferNetworkOk() + return ret } // GetTransferNetworkOk returns a tuple with the TransferNetwork field value // and a boolean to check if the value has been set. -func (o *AreaConfig) GetTransferNetworkOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.TransferNetwork, true +func (o *AreaConfig) GetTransferNetworkOk() (ret AreaConfigGetTransferNetworkRetType, ok bool) { + return getAreaConfigGetTransferNetworkAttributeTypeOk(o.TransferNetwork) } // SetTransferNetwork sets field value -func (o *AreaConfig) SetTransferNetwork(v *string) { - o.TransferNetwork = v +func (o *AreaConfig) SetTransferNetwork(v AreaConfigGetTransferNetworkRetType) { + setAreaConfigGetTransferNetworkAttributeType(&o.TransferNetwork, v) } func (o AreaConfig) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.DefaultNameservers) { - toSerialize["defaultNameservers"] = o.DefaultNameservers + if val, ok := getAreaConfigGetDefaultNameserversAttributeTypeOk(o.DefaultNameservers); ok { + toSerialize["DefaultNameservers"] = val + } + if val, ok := getAreaConfigGetNetworkRangesAttributeTypeOk(o.NetworkRanges); ok { + toSerialize["NetworkRanges"] = val + } + if val, ok := getAreaConfigGetRoutesAttributeTypeOk(o.Routes); ok { + toSerialize["Routes"] = val } - toSerialize["networkRanges"] = o.NetworkRanges - if !IsNil(o.Routes) { - toSerialize["routes"] = o.Routes + if val, ok := getAreaConfigGetTransferNetworkAttributeTypeOk(o.TransferNetwork); ok { + toSerialize["TransferNetwork"] = val } - toSerialize["transferNetwork"] = o.TransferNetwork return toSerialize, nil } diff --git a/services/iaas/model_area_prefix_config_ipv4.go b/services/iaas/model_area_prefix_config_ipv4.go index d722168d7..38e9110f5 100644 --- a/services/iaas/model_area_prefix_config_ipv4.go +++ b/services/iaas/model_area_prefix_config_ipv4.go @@ -17,14 +17,74 @@ import ( // checks if the AreaPrefixConfigIPv4 type satisfies the MappedNullable interface at compile time var _ MappedNullable = &AreaPrefixConfigIPv4{} +/* + types and functions for defaultPrefixLen +*/ + +// isInteger +type AreaPrefixConfigIPv4GetDefaultPrefixLenAttributeType = *int64 +type AreaPrefixConfigIPv4GetDefaultPrefixLenArgType = int64 +type AreaPrefixConfigIPv4GetDefaultPrefixLenRetType = int64 + +func getAreaPrefixConfigIPv4GetDefaultPrefixLenAttributeTypeOk(arg AreaPrefixConfigIPv4GetDefaultPrefixLenAttributeType) (ret AreaPrefixConfigIPv4GetDefaultPrefixLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAreaPrefixConfigIPv4GetDefaultPrefixLenAttributeType(arg *AreaPrefixConfigIPv4GetDefaultPrefixLenAttributeType, val AreaPrefixConfigIPv4GetDefaultPrefixLenRetType) { + *arg = &val +} + +/* + types and functions for maxPrefixLen +*/ + +// isInteger +type AreaPrefixConfigIPv4GetMaxPrefixLenAttributeType = *int64 +type AreaPrefixConfigIPv4GetMaxPrefixLenArgType = int64 +type AreaPrefixConfigIPv4GetMaxPrefixLenRetType = int64 + +func getAreaPrefixConfigIPv4GetMaxPrefixLenAttributeTypeOk(arg AreaPrefixConfigIPv4GetMaxPrefixLenAttributeType) (ret AreaPrefixConfigIPv4GetMaxPrefixLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAreaPrefixConfigIPv4GetMaxPrefixLenAttributeType(arg *AreaPrefixConfigIPv4GetMaxPrefixLenAttributeType, val AreaPrefixConfigIPv4GetMaxPrefixLenRetType) { + *arg = &val +} + +/* + types and functions for minPrefixLen +*/ + +// isInteger +type AreaPrefixConfigIPv4GetMinPrefixLenAttributeType = *int64 +type AreaPrefixConfigIPv4GetMinPrefixLenArgType = int64 +type AreaPrefixConfigIPv4GetMinPrefixLenRetType = int64 + +func getAreaPrefixConfigIPv4GetMinPrefixLenAttributeTypeOk(arg AreaPrefixConfigIPv4GetMinPrefixLenAttributeType) (ret AreaPrefixConfigIPv4GetMinPrefixLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAreaPrefixConfigIPv4GetMinPrefixLenAttributeType(arg *AreaPrefixConfigIPv4GetMinPrefixLenAttributeType, val AreaPrefixConfigIPv4GetMinPrefixLenRetType) { + *arg = &val +} + // AreaPrefixConfigIPv4 The IPv4 prefix config for a network area. type AreaPrefixConfigIPv4 struct { // The default prefix length for networks in the network area. - DefaultPrefixLen *int64 `json:"defaultPrefixLen,omitempty"` + DefaultPrefixLen AreaPrefixConfigIPv4GetDefaultPrefixLenAttributeType `json:"defaultPrefixLen,omitempty"` // The maximal prefix length for networks in the network area. - MaxPrefixLen *int64 `json:"maxPrefixLen,omitempty"` + MaxPrefixLen AreaPrefixConfigIPv4GetMaxPrefixLenAttributeType `json:"maxPrefixLen,omitempty"` // The minimal prefix length for networks in the network area. - MinPrefixLen *int64 `json:"minPrefixLen,omitempty"` + MinPrefixLen AreaPrefixConfigIPv4GetMinPrefixLenAttributeType `json:"minPrefixLen,omitempty"` } // NewAreaPrefixConfigIPv4 instantiates a new AreaPrefixConfigIPv4 object @@ -33,12 +93,6 @@ type AreaPrefixConfigIPv4 struct { // will change when the set of required properties is changed func NewAreaPrefixConfigIPv4() *AreaPrefixConfigIPv4 { this := AreaPrefixConfigIPv4{} - var defaultPrefixLen int64 = 25 - this.DefaultPrefixLen = &defaultPrefixLen - var maxPrefixLen int64 = 29 - this.MaxPrefixLen = &maxPrefixLen - var minPrefixLen int64 = 24 - this.MinPrefixLen = &minPrefixLen return &this } @@ -57,111 +111,84 @@ func NewAreaPrefixConfigIPv4WithDefaults() *AreaPrefixConfigIPv4 { } // GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. -func (o *AreaPrefixConfigIPv4) GetDefaultPrefixLen() *int64 { - if o == nil || IsNil(o.DefaultPrefixLen) { - var ret *int64 - return ret - } - return o.DefaultPrefixLen +func (o *AreaPrefixConfigIPv4) GetDefaultPrefixLen() (res AreaPrefixConfigIPv4GetDefaultPrefixLenRetType) { + res, _ = o.GetDefaultPrefixLenOk() + return } // GetDefaultPrefixLenOk returns a tuple with the DefaultPrefixLen field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AreaPrefixConfigIPv4) GetDefaultPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.DefaultPrefixLen) { - return nil, false - } - return o.DefaultPrefixLen, true +func (o *AreaPrefixConfigIPv4) GetDefaultPrefixLenOk() (ret AreaPrefixConfigIPv4GetDefaultPrefixLenRetType, ok bool) { + return getAreaPrefixConfigIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen) } // HasDefaultPrefixLen returns a boolean if a field has been set. func (o *AreaPrefixConfigIPv4) HasDefaultPrefixLen() bool { - if o != nil && !IsNil(o.DefaultPrefixLen) { - return true - } - - return false + _, ok := o.GetDefaultPrefixLenOk() + return ok } // SetDefaultPrefixLen gets a reference to the given int64 and assigns it to the DefaultPrefixLen field. -func (o *AreaPrefixConfigIPv4) SetDefaultPrefixLen(v *int64) { - o.DefaultPrefixLen = v +func (o *AreaPrefixConfigIPv4) SetDefaultPrefixLen(v AreaPrefixConfigIPv4GetDefaultPrefixLenRetType) { + setAreaPrefixConfigIPv4GetDefaultPrefixLenAttributeType(&o.DefaultPrefixLen, v) } // GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. -func (o *AreaPrefixConfigIPv4) GetMaxPrefixLen() *int64 { - if o == nil || IsNil(o.MaxPrefixLen) { - var ret *int64 - return ret - } - return o.MaxPrefixLen +func (o *AreaPrefixConfigIPv4) GetMaxPrefixLen() (res AreaPrefixConfigIPv4GetMaxPrefixLenRetType) { + res, _ = o.GetMaxPrefixLenOk() + return } // GetMaxPrefixLenOk returns a tuple with the MaxPrefixLen field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AreaPrefixConfigIPv4) GetMaxPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MaxPrefixLen) { - return nil, false - } - return o.MaxPrefixLen, true +func (o *AreaPrefixConfigIPv4) GetMaxPrefixLenOk() (ret AreaPrefixConfigIPv4GetMaxPrefixLenRetType, ok bool) { + return getAreaPrefixConfigIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen) } // HasMaxPrefixLen returns a boolean if a field has been set. func (o *AreaPrefixConfigIPv4) HasMaxPrefixLen() bool { - if o != nil && !IsNil(o.MaxPrefixLen) { - return true - } - - return false + _, ok := o.GetMaxPrefixLenOk() + return ok } // SetMaxPrefixLen gets a reference to the given int64 and assigns it to the MaxPrefixLen field. -func (o *AreaPrefixConfigIPv4) SetMaxPrefixLen(v *int64) { - o.MaxPrefixLen = v +func (o *AreaPrefixConfigIPv4) SetMaxPrefixLen(v AreaPrefixConfigIPv4GetMaxPrefixLenRetType) { + setAreaPrefixConfigIPv4GetMaxPrefixLenAttributeType(&o.MaxPrefixLen, v) } // GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. -func (o *AreaPrefixConfigIPv4) GetMinPrefixLen() *int64 { - if o == nil || IsNil(o.MinPrefixLen) { - var ret *int64 - return ret - } - return o.MinPrefixLen +func (o *AreaPrefixConfigIPv4) GetMinPrefixLen() (res AreaPrefixConfigIPv4GetMinPrefixLenRetType) { + res, _ = o.GetMinPrefixLenOk() + return } // GetMinPrefixLenOk returns a tuple with the MinPrefixLen field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *AreaPrefixConfigIPv4) GetMinPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MinPrefixLen) { - return nil, false - } - return o.MinPrefixLen, true +func (o *AreaPrefixConfigIPv4) GetMinPrefixLenOk() (ret AreaPrefixConfigIPv4GetMinPrefixLenRetType, ok bool) { + return getAreaPrefixConfigIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen) } // HasMinPrefixLen returns a boolean if a field has been set. func (o *AreaPrefixConfigIPv4) HasMinPrefixLen() bool { - if o != nil && !IsNil(o.MinPrefixLen) { - return true - } - - return false + _, ok := o.GetMinPrefixLenOk() + return ok } // SetMinPrefixLen gets a reference to the given int64 and assigns it to the MinPrefixLen field. -func (o *AreaPrefixConfigIPv4) SetMinPrefixLen(v *int64) { - o.MinPrefixLen = v +func (o *AreaPrefixConfigIPv4) SetMinPrefixLen(v AreaPrefixConfigIPv4GetMinPrefixLenRetType) { + setAreaPrefixConfigIPv4GetMinPrefixLenAttributeType(&o.MinPrefixLen, v) } func (o AreaPrefixConfigIPv4) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.DefaultPrefixLen) { - toSerialize["defaultPrefixLen"] = o.DefaultPrefixLen + if val, ok := getAreaPrefixConfigIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen); ok { + toSerialize["DefaultPrefixLen"] = val } - if !IsNil(o.MaxPrefixLen) { - toSerialize["maxPrefixLen"] = o.MaxPrefixLen + if val, ok := getAreaPrefixConfigIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen); ok { + toSerialize["MaxPrefixLen"] = val } - if !IsNil(o.MinPrefixLen) { - toSerialize["minPrefixLen"] = o.MinPrefixLen + if val, ok := getAreaPrefixConfigIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen); ok { + toSerialize["MinPrefixLen"] = val } return toSerialize, nil } diff --git a/services/iaas/model_availability_zone_list_response.go b/services/iaas/model_availability_zone_list_response.go index 11c9bd377..61db846cd 100644 --- a/services/iaas/model_availability_zone_list_response.go +++ b/services/iaas/model_availability_zone_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the AvailabilityZoneListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &AvailabilityZoneListResponse{} +/* + types and functions for items +*/ + +// isArray +type AvailabilityZoneListResponseGetItemsAttributeType = *[]string +type AvailabilityZoneListResponseGetItemsArgType = []string +type AvailabilityZoneListResponseGetItemsRetType = []string + +func getAvailabilityZoneListResponseGetItemsAttributeTypeOk(arg AvailabilityZoneListResponseGetItemsAttributeType) (ret AvailabilityZoneListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAvailabilityZoneListResponseGetItemsAttributeType(arg *AvailabilityZoneListResponseGetItemsAttributeType, val AvailabilityZoneListResponseGetItemsRetType) { + *arg = &val +} + // AvailabilityZoneListResponse Availability Zone list response. type AvailabilityZoneListResponse struct { // A list of availability zones. // REQUIRED - Items *[]string `json:"items"` + Items AvailabilityZoneListResponseGetItemsAttributeType `json:"items"` } type _AvailabilityZoneListResponse AvailabilityZoneListResponse @@ -30,9 +50,9 @@ type _AvailabilityZoneListResponse AvailabilityZoneListResponse // 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 NewAvailabilityZoneListResponse(items *[]string) *AvailabilityZoneListResponse { +func NewAvailabilityZoneListResponse(items AvailabilityZoneListResponseGetItemsArgType) *AvailabilityZoneListResponse { this := AvailabilityZoneListResponse{} - this.Items = items + setAvailabilityZoneListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewAvailabilityZoneListResponseWithDefaults() *AvailabilityZoneListResponse } // GetItems returns the Items field value -func (o *AvailabilityZoneListResponse) GetItems() *[]string { - if o == nil || IsNil(o.Items) { - var ret *[]string - return ret - } - - return o.Items +func (o *AvailabilityZoneListResponse) GetItems() (ret AvailabilityZoneListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *AvailabilityZoneListResponse) GetItemsOk() (*[]string, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *AvailabilityZoneListResponse) GetItemsOk() (ret AvailabilityZoneListResponseGetItemsRetType, ok bool) { + return getAvailabilityZoneListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *AvailabilityZoneListResponse) SetItems(v *[]string) { - o.Items = v +func (o *AvailabilityZoneListResponse) SetItems(v AvailabilityZoneListResponseGetItemsRetType) { + setAvailabilityZoneListResponseGetItemsAttributeType(&o.Items, v) } func (o AvailabilityZoneListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getAvailabilityZoneListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_backup.go b/services/iaas/model_backup.go index ef904a79d..419c228b0 100644 --- a/services/iaas/model_backup.go +++ b/services/iaas/model_backup.go @@ -18,28 +18,234 @@ import ( // checks if the Backup type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Backup{} +/* + types and functions for availabilityZone +*/ + +// isNotNullableString +type BackupGetAvailabilityZoneAttributeType = *string + +func getBackupGetAvailabilityZoneAttributeTypeOk(arg BackupGetAvailabilityZoneAttributeType) (ret BackupGetAvailabilityZoneRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupGetAvailabilityZoneAttributeType(arg *BackupGetAvailabilityZoneAttributeType, val BackupGetAvailabilityZoneRetType) { + *arg = &val +} + +type BackupGetAvailabilityZoneArgType = string +type BackupGetAvailabilityZoneRetType = string + +/* + types and functions for createdAt +*/ + +// isDateTime +type BackupGetCreatedAtAttributeType = *time.Time +type BackupGetCreatedAtArgType = time.Time +type BackupGetCreatedAtRetType = time.Time + +func getBackupGetCreatedAtAttributeTypeOk(arg BackupGetCreatedAtAttributeType) (ret BackupGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupGetCreatedAtAttributeType(arg *BackupGetCreatedAtAttributeType, val BackupGetCreatedAtRetType) { + *arg = &val +} + +/* + 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 +*/ + +// isFreeform +type BackupGetLabelsAttributeType = *map[string]interface{} +type BackupGetLabelsArgType = map[string]interface{} +type BackupGetLabelsRetType = map[string]interface{} + +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 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 snapshotId +*/ + +// isNotNullableString +type BackupGetSnapshotIdAttributeType = *string + +func getBackupGetSnapshotIdAttributeTypeOk(arg BackupGetSnapshotIdAttributeType) (ret BackupGetSnapshotIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupGetSnapshotIdAttributeType(arg *BackupGetSnapshotIdAttributeType, val BackupGetSnapshotIdRetType) { + *arg = &val +} + +type BackupGetSnapshotIdArgType = string +type BackupGetSnapshotIdRetType = string + +/* + types and functions for status +*/ + +// isNotNullableString +type BackupGetStatusAttributeType = *string + +func getBackupGetStatusAttributeTypeOk(arg BackupGetStatusAttributeType) (ret BackupGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupGetStatusAttributeType(arg *BackupGetStatusAttributeType, val BackupGetStatusRetType) { + *arg = &val +} + +type BackupGetStatusArgType = string +type BackupGetStatusRetType = string + +/* + types and functions for updatedAt +*/ + +// isDateTime +type BackupGetUpdatedAtAttributeType = *time.Time +type BackupGetUpdatedAtArgType = time.Time +type BackupGetUpdatedAtRetType = time.Time + +func getBackupGetUpdatedAtAttributeTypeOk(arg BackupGetUpdatedAtAttributeType) (ret BackupGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupGetUpdatedAtAttributeType(arg *BackupGetUpdatedAtAttributeType, val BackupGetUpdatedAtRetType) { + *arg = &val +} + +/* + types and functions for volumeId +*/ + +// isNotNullableString +type BackupGetVolumeIdAttributeType = *string + +func getBackupGetVolumeIdAttributeTypeOk(arg BackupGetVolumeIdAttributeType) (ret BackupGetVolumeIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupGetVolumeIdAttributeType(arg *BackupGetVolumeIdAttributeType, val BackupGetVolumeIdRetType) { + *arg = &val +} + +type BackupGetVolumeIdArgType = string +type BackupGetVolumeIdRetType = string + // Backup Object that represents a backup. type Backup struct { // Object that represents an availability zone. - AvailabilityZone *string `json:"availabilityZone,omitempty"` + AvailabilityZone BackupGetAvailabilityZoneAttributeType `json:"availabilityZone,omitempty"` // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt BackupGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id BackupGetIdAttributeType `json:"id,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels BackupGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty"` + Name BackupGetNameAttributeType `json:"name,omitempty"` // Size in Gigabyte. - Size *int64 `json:"size,omitempty"` + Size BackupGetSizeAttributeType `json:"size,omitempty"` // Universally Unique Identifier (UUID). - SnapshotId *string `json:"snapshotId,omitempty"` + SnapshotId BackupGetSnapshotIdAttributeType `json:"snapshotId,omitempty"` // The status of a backup object. Possible values: `AVAILABLE`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`. - Status *string `json:"status,omitempty"` + Status BackupGetStatusAttributeType `json:"status,omitempty"` // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAt BackupGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` // Universally Unique Identifier (UUID). - VolumeId *string `json:"volumeId,omitempty"` + VolumeId BackupGetVolumeIdAttributeType `json:"volumeId,omitempty"` } // NewBackup instantiates a new Backup object @@ -60,356 +266,266 @@ func NewBackupWithDefaults() *Backup { } // GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. -func (o *Backup) GetAvailabilityZone() *string { - if o == nil || IsNil(o.AvailabilityZone) { - var ret *string - return ret - } - return o.AvailabilityZone +func (o *Backup) GetAvailabilityZone() (res BackupGetAvailabilityZoneRetType) { + res, _ = o.GetAvailabilityZoneOk() + return } // GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Backup) GetAvailabilityZoneOk() (*string, bool) { - if o == nil || IsNil(o.AvailabilityZone) { - return nil, false - } - return o.AvailabilityZone, true +func (o *Backup) GetAvailabilityZoneOk() (ret BackupGetAvailabilityZoneRetType, ok bool) { + return getBackupGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) } // HasAvailabilityZone returns a boolean if a field has been set. func (o *Backup) HasAvailabilityZone() bool { - if o != nil && !IsNil(o.AvailabilityZone) { - return true - } - - return false + _, ok := o.GetAvailabilityZoneOk() + return ok } // SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. -func (o *Backup) SetAvailabilityZone(v *string) { - o.AvailabilityZone = v +func (o *Backup) SetAvailabilityZone(v BackupGetAvailabilityZoneRetType) { + setBackupGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *Backup) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - return o.CreatedAt +func (o *Backup) GetCreatedAt() (res BackupGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return } // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Backup) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true +func (o *Backup) GetCreatedAtOk() (ret BackupGetCreatedAtRetType, ok bool) { + return getBackupGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. func (o *Backup) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false + _, ok := o.GetCreatedAtOk() + return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *Backup) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *Backup) SetCreatedAt(v BackupGetCreatedAtRetType) { + setBackupGetCreatedAtAttributeType(&o.CreatedAt, 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() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - 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() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, 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 map[string]interface{} and assigns it to the Labels field. -func (o *Backup) SetLabels(v *map[string]interface{}) { - 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) } // 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) } // GetSnapshotId returns the SnapshotId field value if set, zero value otherwise. -func (o *Backup) GetSnapshotId() *string { - if o == nil || IsNil(o.SnapshotId) { - var ret *string - return ret - } - return o.SnapshotId +func (o *Backup) GetSnapshotId() (res BackupGetSnapshotIdRetType) { + res, _ = o.GetSnapshotIdOk() + return } // GetSnapshotIdOk returns a tuple with the SnapshotId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Backup) GetSnapshotIdOk() (*string, bool) { - if o == nil || IsNil(o.SnapshotId) { - return nil, false - } - return o.SnapshotId, true +func (o *Backup) GetSnapshotIdOk() (ret BackupGetSnapshotIdRetType, ok bool) { + return getBackupGetSnapshotIdAttributeTypeOk(o.SnapshotId) } // HasSnapshotId returns a boolean if a field has been set. func (o *Backup) HasSnapshotId() bool { - if o != nil && !IsNil(o.SnapshotId) { - return true - } - - return false + _, ok := o.GetSnapshotIdOk() + return ok } // SetSnapshotId gets a reference to the given string and assigns it to the SnapshotId field. -func (o *Backup) SetSnapshotId(v *string) { - o.SnapshotId = v +func (o *Backup) SetSnapshotId(v BackupGetSnapshotIdRetType) { + setBackupGetSnapshotIdAttributeType(&o.SnapshotId, v) } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *Backup) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - return o.Status +func (o *Backup) GetStatus() (res BackupGetStatusRetType) { + 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 *Backup) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true +func (o *Backup) GetStatusOk() (ret BackupGetStatusRetType, ok bool) { + return getBackupGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. func (o *Backup) 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 *Backup) SetStatus(v *string) { - o.Status = v +func (o *Backup) SetStatus(v BackupGetStatusRetType) { + setBackupGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *Backup) GetUpdatedAt() *time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret *time.Time - return ret - } - return o.UpdatedAt +func (o *Backup) GetUpdatedAt() (res BackupGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Backup) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true +func (o *Backup) GetUpdatedAtOk() (ret BackupGetUpdatedAtRetType, ok bool) { + return getBackupGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. func (o *Backup) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false + _, ok := o.GetUpdatedAtOk() + return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *Backup) SetUpdatedAt(v *time.Time) { - o.UpdatedAt = v +func (o *Backup) SetUpdatedAt(v BackupGetUpdatedAtRetType) { + setBackupGetUpdatedAtAttributeType(&o.UpdatedAt, v) } // GetVolumeId returns the VolumeId field value if set, zero value otherwise. -func (o *Backup) GetVolumeId() *string { - if o == nil || IsNil(o.VolumeId) { - var ret *string - return ret - } - return o.VolumeId +func (o *Backup) GetVolumeId() (res BackupGetVolumeIdRetType) { + res, _ = o.GetVolumeIdOk() + return } // GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Backup) GetVolumeIdOk() (*string, bool) { - if o == nil || IsNil(o.VolumeId) { - return nil, false - } - return o.VolumeId, true +func (o *Backup) GetVolumeIdOk() (ret BackupGetVolumeIdRetType, ok bool) { + return getBackupGetVolumeIdAttributeTypeOk(o.VolumeId) } // HasVolumeId returns a boolean if a field has been set. func (o *Backup) HasVolumeId() bool { - if o != nil && !IsNil(o.VolumeId) { - return true - } - - return false + _, ok := o.GetVolumeIdOk() + return ok } // SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. -func (o *Backup) SetVolumeId(v *string) { - o.VolumeId = v +func (o *Backup) SetVolumeId(v BackupGetVolumeIdRetType) { + setBackupGetVolumeIdAttributeType(&o.VolumeId, v) } func (o Backup) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.AvailabilityZone) { - toSerialize["availabilityZone"] = o.AvailabilityZone + if val, ok := getBackupGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { + toSerialize["AvailabilityZone"] = val } - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt + if val, ok := getBackupGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = 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.Size) { - toSerialize["size"] = o.Size + if val, ok := getBackupGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val } - if !IsNil(o.SnapshotId) { - toSerialize["snapshotId"] = o.SnapshotId + if val, ok := getBackupGetSnapshotIdAttributeTypeOk(o.SnapshotId); ok { + toSerialize["SnapshotId"] = val } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status + if val, ok := getBackupGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt + if val, ok := getBackupGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val } - if !IsNil(o.VolumeId) { - toSerialize["volumeId"] = o.VolumeId + if val, ok := getBackupGetVolumeIdAttributeTypeOk(o.VolumeId); ok { + toSerialize["VolumeId"] = val } return toSerialize, nil } diff --git a/services/iaas/model_backup_list_response.go b/services/iaas/model_backup_list_response.go index eac2a32aa..1ae74018b 100644 --- a/services/iaas/model_backup_list_response.go +++ b/services/iaas/model_backup_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the BackupListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &BackupListResponse{} +/* + types and functions for items +*/ + +// isArray +type BackupListResponseGetItemsAttributeType = *[]Backup +type BackupListResponseGetItemsArgType = []Backup +type BackupListResponseGetItemsRetType = []Backup + +func getBackupListResponseGetItemsAttributeTypeOk(arg BackupListResponseGetItemsAttributeType) (ret BackupListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupListResponseGetItemsAttributeType(arg *BackupListResponseGetItemsAttributeType, val BackupListResponseGetItemsRetType) { + *arg = &val +} + // BackupListResponse Backup list response. type BackupListResponse struct { // A list containing backup objects. // REQUIRED - Items *[]Backup `json:"items"` + Items BackupListResponseGetItemsAttributeType `json:"items"` } type _BackupListResponse BackupListResponse @@ -30,9 +50,9 @@ type _BackupListResponse BackupListResponse // 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 NewBackupListResponse(items *[]Backup) *BackupListResponse { +func NewBackupListResponse(items BackupListResponseGetItemsArgType) *BackupListResponse { this := BackupListResponse{} - this.Items = items + setBackupListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewBackupListResponseWithDefaults() *BackupListResponse { } // GetItems returns the Items field value -func (o *BackupListResponse) GetItems() *[]Backup { - if o == nil || IsNil(o.Items) { - var ret *[]Backup - return ret - } - - return o.Items +func (o *BackupListResponse) GetItems() (ret BackupListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *BackupListResponse) GetItemsOk() (*[]Backup, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *BackupListResponse) GetItemsOk() (ret BackupListResponseGetItemsRetType, ok bool) { + return getBackupListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *BackupListResponse) SetItems(v *[]Backup) { - o.Items = v +func (o *BackupListResponse) SetItems(v BackupListResponseGetItemsRetType) { + setBackupListResponseGetItemsAttributeType(&o.Items, v) } func (o BackupListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getBackupListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_backup_source.go b/services/iaas/model_backup_source.go index d6b729009..70f9b30f8 100644 --- a/services/iaas/model_backup_source.go +++ b/services/iaas/model_backup_source.go @@ -17,14 +17,56 @@ import ( // checks if the BackupSource type satisfies the MappedNullable interface at compile time var _ MappedNullable = &BackupSource{} +/* + types and functions for id +*/ + +// isNotNullableString +type BackupSourceGetIdAttributeType = *string + +func getBackupSourceGetIdAttributeTypeOk(arg BackupSourceGetIdAttributeType) (ret BackupSourceGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupSourceGetIdAttributeType(arg *BackupSourceGetIdAttributeType, val BackupSourceGetIdRetType) { + *arg = &val +} + +type BackupSourceGetIdArgType = string +type BackupSourceGetIdRetType = string + +/* + types and functions for type +*/ + +// isNotNullableString +type BackupSourceGetTypeAttributeType = *string + +func getBackupSourceGetTypeAttributeTypeOk(arg BackupSourceGetTypeAttributeType) (ret BackupSourceGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBackupSourceGetTypeAttributeType(arg *BackupSourceGetTypeAttributeType, val BackupSourceGetTypeRetType) { + *arg = &val +} + +type BackupSourceGetTypeArgType = string +type BackupSourceGetTypeRetType = string + // BackupSource The source object of a backup. type BackupSource struct { // Universally Unique Identifier (UUID). // REQUIRED - Id *string `json:"id"` + Id BackupSourceGetIdAttributeType `json:"id"` // The source types of a backup. Possible values: `volume`, `snapshot`. // REQUIRED - Type *string `json:"type"` + Type BackupSourceGetTypeAttributeType `json:"type"` } type _BackupSource BackupSource @@ -33,10 +75,10 @@ type _BackupSource BackupSource // 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 NewBackupSource(id *string, type_ *string) *BackupSource { +func NewBackupSource(id BackupSourceGetIdArgType, type_ BackupSourceGetTypeArgType) *BackupSource { this := BackupSource{} - this.Id = id - this.Type = type_ + setBackupSourceGetIdAttributeType(&this.Id, id) + setBackupSourceGetTypeAttributeType(&this.Type, type_) return &this } @@ -49,57 +91,47 @@ func NewBackupSourceWithDefaults() *BackupSource { } // GetId returns the Id field value -func (o *BackupSource) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - - return o.Id +func (o *BackupSource) GetId() (ret BackupSourceGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *BackupSource) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *BackupSource) GetIdOk() (ret BackupSourceGetIdRetType, ok bool) { + return getBackupSourceGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *BackupSource) SetId(v *string) { - o.Id = v +func (o *BackupSource) SetId(v BackupSourceGetIdRetType) { + setBackupSourceGetIdAttributeType(&o.Id, v) } // GetType returns the Type field value -func (o *BackupSource) GetType() *string { - if o == nil || IsNil(o.Type) { - var ret *string - return ret - } - - return o.Type +func (o *BackupSource) GetType() (ret BackupSourceGetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret } // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *BackupSource) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Type, true +func (o *BackupSource) GetTypeOk() (ret BackupSourceGetTypeRetType, ok bool) { + return getBackupSourceGetTypeAttributeTypeOk(o.Type) } // SetType sets field value -func (o *BackupSource) SetType(v *string) { - o.Type = v +func (o *BackupSource) SetType(v BackupSourceGetTypeRetType) { + setBackupSourceGetTypeAttributeType(&o.Type, v) } func (o BackupSource) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["type"] = o.Type + if val, ok := getBackupSourceGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getBackupSourceGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_base_security_group_rule.go b/services/iaas/model_base_security_group_rule.go index bce790e94..378a32877 100644 --- a/services/iaas/model_base_security_group_rule.go +++ b/services/iaas/model_base_security_group_rule.go @@ -17,25 +17,212 @@ import ( // checks if the BaseSecurityGroupRule type satisfies the MappedNullable interface at compile time var _ MappedNullable = &BaseSecurityGroupRule{} +/* + types and functions for description +*/ + +// isNotNullableString +type BaseSecurityGroupRuleGetDescriptionAttributeType = *string + +func getBaseSecurityGroupRuleGetDescriptionAttributeTypeOk(arg BaseSecurityGroupRuleGetDescriptionAttributeType) (ret BaseSecurityGroupRuleGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBaseSecurityGroupRuleGetDescriptionAttributeType(arg *BaseSecurityGroupRuleGetDescriptionAttributeType, val BaseSecurityGroupRuleGetDescriptionRetType) { + *arg = &val +} + +type BaseSecurityGroupRuleGetDescriptionArgType = string +type BaseSecurityGroupRuleGetDescriptionRetType = string + +/* + types and functions for direction +*/ + +// isNotNullableString +type BaseSecurityGroupRuleGetDirectionAttributeType = *string + +func getBaseSecurityGroupRuleGetDirectionAttributeTypeOk(arg BaseSecurityGroupRuleGetDirectionAttributeType) (ret BaseSecurityGroupRuleGetDirectionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBaseSecurityGroupRuleGetDirectionAttributeType(arg *BaseSecurityGroupRuleGetDirectionAttributeType, val BaseSecurityGroupRuleGetDirectionRetType) { + *arg = &val +} + +type BaseSecurityGroupRuleGetDirectionArgType = string +type BaseSecurityGroupRuleGetDirectionRetType = string + +/* + types and functions for ethertype +*/ + +// isNotNullableString +type BaseSecurityGroupRuleGetEthertypeAttributeType = *string + +func getBaseSecurityGroupRuleGetEthertypeAttributeTypeOk(arg BaseSecurityGroupRuleGetEthertypeAttributeType) (ret BaseSecurityGroupRuleGetEthertypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBaseSecurityGroupRuleGetEthertypeAttributeType(arg *BaseSecurityGroupRuleGetEthertypeAttributeType, val BaseSecurityGroupRuleGetEthertypeRetType) { + *arg = &val +} + +type BaseSecurityGroupRuleGetEthertypeArgType = string +type BaseSecurityGroupRuleGetEthertypeRetType = string + +/* + types and functions for icmpParameters +*/ + +// isModel +type BaseSecurityGroupRuleGetIcmpParametersAttributeType = *ICMPParameters +type BaseSecurityGroupRuleGetIcmpParametersArgType = ICMPParameters +type BaseSecurityGroupRuleGetIcmpParametersRetType = ICMPParameters + +func getBaseSecurityGroupRuleGetIcmpParametersAttributeTypeOk(arg BaseSecurityGroupRuleGetIcmpParametersAttributeType) (ret BaseSecurityGroupRuleGetIcmpParametersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBaseSecurityGroupRuleGetIcmpParametersAttributeType(arg *BaseSecurityGroupRuleGetIcmpParametersAttributeType, val BaseSecurityGroupRuleGetIcmpParametersRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type BaseSecurityGroupRuleGetIdAttributeType = *string + +func getBaseSecurityGroupRuleGetIdAttributeTypeOk(arg BaseSecurityGroupRuleGetIdAttributeType) (ret BaseSecurityGroupRuleGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBaseSecurityGroupRuleGetIdAttributeType(arg *BaseSecurityGroupRuleGetIdAttributeType, val BaseSecurityGroupRuleGetIdRetType) { + *arg = &val +} + +type BaseSecurityGroupRuleGetIdArgType = string +type BaseSecurityGroupRuleGetIdRetType = string + +/* + types and functions for ipRange +*/ + +// isNotNullableString +type BaseSecurityGroupRuleGetIpRangeAttributeType = *string + +func getBaseSecurityGroupRuleGetIpRangeAttributeTypeOk(arg BaseSecurityGroupRuleGetIpRangeAttributeType) (ret BaseSecurityGroupRuleGetIpRangeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBaseSecurityGroupRuleGetIpRangeAttributeType(arg *BaseSecurityGroupRuleGetIpRangeAttributeType, val BaseSecurityGroupRuleGetIpRangeRetType) { + *arg = &val +} + +type BaseSecurityGroupRuleGetIpRangeArgType = string +type BaseSecurityGroupRuleGetIpRangeRetType = string + +/* + types and functions for portRange +*/ + +// isModel +type BaseSecurityGroupRuleGetPortRangeAttributeType = *PortRange +type BaseSecurityGroupRuleGetPortRangeArgType = PortRange +type BaseSecurityGroupRuleGetPortRangeRetType = PortRange + +func getBaseSecurityGroupRuleGetPortRangeAttributeTypeOk(arg BaseSecurityGroupRuleGetPortRangeAttributeType) (ret BaseSecurityGroupRuleGetPortRangeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBaseSecurityGroupRuleGetPortRangeAttributeType(arg *BaseSecurityGroupRuleGetPortRangeAttributeType, val BaseSecurityGroupRuleGetPortRangeRetType) { + *arg = &val +} + +/* + types and functions for remoteSecurityGroupId +*/ + +// isNotNullableString +type BaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType = *string + +func getBaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeTypeOk(arg BaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType) (ret BaseSecurityGroupRuleGetRemoteSecurityGroupIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType(arg *BaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType, val BaseSecurityGroupRuleGetRemoteSecurityGroupIdRetType) { + *arg = &val +} + +type BaseSecurityGroupRuleGetRemoteSecurityGroupIdArgType = string +type BaseSecurityGroupRuleGetRemoteSecurityGroupIdRetType = string + +/* + types and functions for securityGroupId +*/ + +// isNotNullableString +type BaseSecurityGroupRuleGetSecurityGroupIdAttributeType = *string + +func getBaseSecurityGroupRuleGetSecurityGroupIdAttributeTypeOk(arg BaseSecurityGroupRuleGetSecurityGroupIdAttributeType) (ret BaseSecurityGroupRuleGetSecurityGroupIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBaseSecurityGroupRuleGetSecurityGroupIdAttributeType(arg *BaseSecurityGroupRuleGetSecurityGroupIdAttributeType, val BaseSecurityGroupRuleGetSecurityGroupIdRetType) { + *arg = &val +} + +type BaseSecurityGroupRuleGetSecurityGroupIdArgType = string +type BaseSecurityGroupRuleGetSecurityGroupIdRetType = string + // BaseSecurityGroupRule The base schema for a security group rule. type BaseSecurityGroupRule struct { // Description Object. Allows string up to 127 Characters. - Description *string `json:"description,omitempty"` + Description BaseSecurityGroupRuleGetDescriptionAttributeType `json:"description,omitempty"` // The direction of the traffic which the rule should match. // REQUIRED - Direction *string `json:"direction"` + Direction BaseSecurityGroupRuleGetDirectionAttributeType `json:"direction"` // The ethertype which the rule should match. - Ethertype *string `json:"ethertype,omitempty"` - IcmpParameters *ICMPParameters `json:"icmpParameters,omitempty"` + Ethertype BaseSecurityGroupRuleGetEthertypeAttributeType `json:"ethertype,omitempty"` + IcmpParameters BaseSecurityGroupRuleGetIcmpParametersAttributeType `json:"icmpParameters,omitempty"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id BaseSecurityGroupRuleGetIdAttributeType `json:"id,omitempty"` // Classless Inter-Domain Routing (CIDR). - IpRange *string `json:"ipRange,omitempty"` - PortRange *PortRange `json:"portRange,omitempty"` + IpRange BaseSecurityGroupRuleGetIpRangeAttributeType `json:"ipRange,omitempty"` + PortRange BaseSecurityGroupRuleGetPortRangeAttributeType `json:"portRange,omitempty"` // Universally Unique Identifier (UUID). - RemoteSecurityGroupId *string `json:"remoteSecurityGroupId,omitempty"` + RemoteSecurityGroupId BaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType `json:"remoteSecurityGroupId,omitempty"` // Universally Unique Identifier (UUID). - SecurityGroupId *string `json:"securityGroupId,omitempty"` + SecurityGroupId BaseSecurityGroupRuleGetSecurityGroupIdAttributeType `json:"securityGroupId,omitempty"` } type _BaseSecurityGroupRule BaseSecurityGroupRule @@ -44,11 +231,9 @@ type _BaseSecurityGroupRule BaseSecurityGroupRule // 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 NewBaseSecurityGroupRule(direction *string) *BaseSecurityGroupRule { +func NewBaseSecurityGroupRule(direction BaseSecurityGroupRuleGetDirectionArgType) *BaseSecurityGroupRule { this := BaseSecurityGroupRule{} - this.Direction = direction - var ethertype string = "IPv4" - this.Ethertype = ðertype + setBaseSecurityGroupRuleGetDirectionAttributeType(&this.Direction, direction) return &this } @@ -63,311 +248,234 @@ func NewBaseSecurityGroupRuleWithDefaults() *BaseSecurityGroupRule { } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *BaseSecurityGroupRule) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *BaseSecurityGroupRule) GetDescription() (res BaseSecurityGroupRuleGetDescriptionRetType) { + 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 *BaseSecurityGroupRule) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *BaseSecurityGroupRule) GetDescriptionOk() (ret BaseSecurityGroupRuleGetDescriptionRetType, ok bool) { + return getBaseSecurityGroupRuleGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *BaseSecurityGroupRule) 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 *BaseSecurityGroupRule) SetDescription(v *string) { - o.Description = v +func (o *BaseSecurityGroupRule) SetDescription(v BaseSecurityGroupRuleGetDescriptionRetType) { + setBaseSecurityGroupRuleGetDescriptionAttributeType(&o.Description, v) } // GetDirection returns the Direction field value -func (o *BaseSecurityGroupRule) GetDirection() *string { - if o == nil || IsNil(o.Direction) { - var ret *string - return ret - } - - return o.Direction +func (o *BaseSecurityGroupRule) GetDirection() (ret BaseSecurityGroupRuleGetDirectionRetType) { + ret, _ = o.GetDirectionOk() + return ret } // GetDirectionOk returns a tuple with the Direction field value // and a boolean to check if the value has been set. -func (o *BaseSecurityGroupRule) GetDirectionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Direction, true +func (o *BaseSecurityGroupRule) GetDirectionOk() (ret BaseSecurityGroupRuleGetDirectionRetType, ok bool) { + return getBaseSecurityGroupRuleGetDirectionAttributeTypeOk(o.Direction) } // SetDirection sets field value -func (o *BaseSecurityGroupRule) SetDirection(v *string) { - o.Direction = v +func (o *BaseSecurityGroupRule) SetDirection(v BaseSecurityGroupRuleGetDirectionRetType) { + setBaseSecurityGroupRuleGetDirectionAttributeType(&o.Direction, v) } // GetEthertype returns the Ethertype field value if set, zero value otherwise. -func (o *BaseSecurityGroupRule) GetEthertype() *string { - if o == nil || IsNil(o.Ethertype) { - var ret *string - return ret - } - return o.Ethertype +func (o *BaseSecurityGroupRule) GetEthertype() (res BaseSecurityGroupRuleGetEthertypeRetType) { + res, _ = o.GetEthertypeOk() + return } // GetEthertypeOk returns a tuple with the Ethertype field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *BaseSecurityGroupRule) GetEthertypeOk() (*string, bool) { - if o == nil || IsNil(o.Ethertype) { - return nil, false - } - return o.Ethertype, true +func (o *BaseSecurityGroupRule) GetEthertypeOk() (ret BaseSecurityGroupRuleGetEthertypeRetType, ok bool) { + return getBaseSecurityGroupRuleGetEthertypeAttributeTypeOk(o.Ethertype) } // HasEthertype returns a boolean if a field has been set. func (o *BaseSecurityGroupRule) HasEthertype() bool { - if o != nil && !IsNil(o.Ethertype) { - return true - } - - return false + _, ok := o.GetEthertypeOk() + return ok } // SetEthertype gets a reference to the given string and assigns it to the Ethertype field. -func (o *BaseSecurityGroupRule) SetEthertype(v *string) { - o.Ethertype = v +func (o *BaseSecurityGroupRule) SetEthertype(v BaseSecurityGroupRuleGetEthertypeRetType) { + setBaseSecurityGroupRuleGetEthertypeAttributeType(&o.Ethertype, v) } // GetIcmpParameters returns the IcmpParameters field value if set, zero value otherwise. -func (o *BaseSecurityGroupRule) GetIcmpParameters() *ICMPParameters { - if o == nil || IsNil(o.IcmpParameters) { - var ret *ICMPParameters - return ret - } - return o.IcmpParameters +func (o *BaseSecurityGroupRule) GetIcmpParameters() (res BaseSecurityGroupRuleGetIcmpParametersRetType) { + res, _ = o.GetIcmpParametersOk() + return } // GetIcmpParametersOk returns a tuple with the IcmpParameters field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *BaseSecurityGroupRule) GetIcmpParametersOk() (*ICMPParameters, bool) { - if o == nil || IsNil(o.IcmpParameters) { - return nil, false - } - return o.IcmpParameters, true +func (o *BaseSecurityGroupRule) GetIcmpParametersOk() (ret BaseSecurityGroupRuleGetIcmpParametersRetType, ok bool) { + return getBaseSecurityGroupRuleGetIcmpParametersAttributeTypeOk(o.IcmpParameters) } // HasIcmpParameters returns a boolean if a field has been set. func (o *BaseSecurityGroupRule) HasIcmpParameters() bool { - if o != nil && !IsNil(o.IcmpParameters) { - return true - } - - return false + _, ok := o.GetIcmpParametersOk() + return ok } // SetIcmpParameters gets a reference to the given ICMPParameters and assigns it to the IcmpParameters field. -func (o *BaseSecurityGroupRule) SetIcmpParameters(v *ICMPParameters) { - o.IcmpParameters = v +func (o *BaseSecurityGroupRule) SetIcmpParameters(v BaseSecurityGroupRuleGetIcmpParametersRetType) { + setBaseSecurityGroupRuleGetIcmpParametersAttributeType(&o.IcmpParameters, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *BaseSecurityGroupRule) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *BaseSecurityGroupRule) GetId() (res BaseSecurityGroupRuleGetIdRetType) { + 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 *BaseSecurityGroupRule) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *BaseSecurityGroupRule) GetIdOk() (ret BaseSecurityGroupRuleGetIdRetType, ok bool) { + return getBaseSecurityGroupRuleGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *BaseSecurityGroupRule) 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 *BaseSecurityGroupRule) SetId(v *string) { - o.Id = v +func (o *BaseSecurityGroupRule) SetId(v BaseSecurityGroupRuleGetIdRetType) { + setBaseSecurityGroupRuleGetIdAttributeType(&o.Id, v) } // GetIpRange returns the IpRange field value if set, zero value otherwise. -func (o *BaseSecurityGroupRule) GetIpRange() *string { - if o == nil || IsNil(o.IpRange) { - var ret *string - return ret - } - return o.IpRange +func (o *BaseSecurityGroupRule) GetIpRange() (res BaseSecurityGroupRuleGetIpRangeRetType) { + res, _ = o.GetIpRangeOk() + return } // GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *BaseSecurityGroupRule) GetIpRangeOk() (*string, bool) { - if o == nil || IsNil(o.IpRange) { - return nil, false - } - return o.IpRange, true +func (o *BaseSecurityGroupRule) GetIpRangeOk() (ret BaseSecurityGroupRuleGetIpRangeRetType, ok bool) { + return getBaseSecurityGroupRuleGetIpRangeAttributeTypeOk(o.IpRange) } // HasIpRange returns a boolean if a field has been set. func (o *BaseSecurityGroupRule) HasIpRange() bool { - if o != nil && !IsNil(o.IpRange) { - return true - } - - return false + _, ok := o.GetIpRangeOk() + return ok } // SetIpRange gets a reference to the given string and assigns it to the IpRange field. -func (o *BaseSecurityGroupRule) SetIpRange(v *string) { - o.IpRange = v +func (o *BaseSecurityGroupRule) SetIpRange(v BaseSecurityGroupRuleGetIpRangeRetType) { + setBaseSecurityGroupRuleGetIpRangeAttributeType(&o.IpRange, v) } // GetPortRange returns the PortRange field value if set, zero value otherwise. -func (o *BaseSecurityGroupRule) GetPortRange() *PortRange { - if o == nil || IsNil(o.PortRange) { - var ret *PortRange - return ret - } - return o.PortRange +func (o *BaseSecurityGroupRule) GetPortRange() (res BaseSecurityGroupRuleGetPortRangeRetType) { + res, _ = o.GetPortRangeOk() + return } // GetPortRangeOk returns a tuple with the PortRange field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *BaseSecurityGroupRule) GetPortRangeOk() (*PortRange, bool) { - if o == nil || IsNil(o.PortRange) { - return nil, false - } - return o.PortRange, true +func (o *BaseSecurityGroupRule) GetPortRangeOk() (ret BaseSecurityGroupRuleGetPortRangeRetType, ok bool) { + return getBaseSecurityGroupRuleGetPortRangeAttributeTypeOk(o.PortRange) } // HasPortRange returns a boolean if a field has been set. func (o *BaseSecurityGroupRule) HasPortRange() bool { - if o != nil && !IsNil(o.PortRange) { - return true - } - - return false + _, ok := o.GetPortRangeOk() + return ok } // SetPortRange gets a reference to the given PortRange and assigns it to the PortRange field. -func (o *BaseSecurityGroupRule) SetPortRange(v *PortRange) { - o.PortRange = v +func (o *BaseSecurityGroupRule) SetPortRange(v BaseSecurityGroupRuleGetPortRangeRetType) { + setBaseSecurityGroupRuleGetPortRangeAttributeType(&o.PortRange, v) } // GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. -func (o *BaseSecurityGroupRule) GetRemoteSecurityGroupId() *string { - if o == nil || IsNil(o.RemoteSecurityGroupId) { - var ret *string - return ret - } - return o.RemoteSecurityGroupId +func (o *BaseSecurityGroupRule) GetRemoteSecurityGroupId() (res BaseSecurityGroupRuleGetRemoteSecurityGroupIdRetType) { + res, _ = o.GetRemoteSecurityGroupIdOk() + return } // GetRemoteSecurityGroupIdOk returns a tuple with the RemoteSecurityGroupId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *BaseSecurityGroupRule) GetRemoteSecurityGroupIdOk() (*string, bool) { - if o == nil || IsNil(o.RemoteSecurityGroupId) { - return nil, false - } - return o.RemoteSecurityGroupId, true +func (o *BaseSecurityGroupRule) GetRemoteSecurityGroupIdOk() (ret BaseSecurityGroupRuleGetRemoteSecurityGroupIdRetType, ok bool) { + return getBaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeTypeOk(o.RemoteSecurityGroupId) } // HasRemoteSecurityGroupId returns a boolean if a field has been set. func (o *BaseSecurityGroupRule) HasRemoteSecurityGroupId() bool { - if o != nil && !IsNil(o.RemoteSecurityGroupId) { - return true - } - - return false + _, ok := o.GetRemoteSecurityGroupIdOk() + return ok } // SetRemoteSecurityGroupId gets a reference to the given string and assigns it to the RemoteSecurityGroupId field. -func (o *BaseSecurityGroupRule) SetRemoteSecurityGroupId(v *string) { - o.RemoteSecurityGroupId = v +func (o *BaseSecurityGroupRule) SetRemoteSecurityGroupId(v BaseSecurityGroupRuleGetRemoteSecurityGroupIdRetType) { + setBaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType(&o.RemoteSecurityGroupId, v) } // GetSecurityGroupId returns the SecurityGroupId field value if set, zero value otherwise. -func (o *BaseSecurityGroupRule) GetSecurityGroupId() *string { - if o == nil || IsNil(o.SecurityGroupId) { - var ret *string - return ret - } - return o.SecurityGroupId +func (o *BaseSecurityGroupRule) GetSecurityGroupId() (res BaseSecurityGroupRuleGetSecurityGroupIdRetType) { + res, _ = o.GetSecurityGroupIdOk() + return } // GetSecurityGroupIdOk returns a tuple with the SecurityGroupId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *BaseSecurityGroupRule) GetSecurityGroupIdOk() (*string, bool) { - if o == nil || IsNil(o.SecurityGroupId) { - return nil, false - } - return o.SecurityGroupId, true +func (o *BaseSecurityGroupRule) GetSecurityGroupIdOk() (ret BaseSecurityGroupRuleGetSecurityGroupIdRetType, ok bool) { + return getBaseSecurityGroupRuleGetSecurityGroupIdAttributeTypeOk(o.SecurityGroupId) } // HasSecurityGroupId returns a boolean if a field has been set. func (o *BaseSecurityGroupRule) HasSecurityGroupId() bool { - if o != nil && !IsNil(o.SecurityGroupId) { - return true - } - - return false + _, ok := o.GetSecurityGroupIdOk() + return ok } // SetSecurityGroupId gets a reference to the given string and assigns it to the SecurityGroupId field. -func (o *BaseSecurityGroupRule) SetSecurityGroupId(v *string) { - o.SecurityGroupId = v +func (o *BaseSecurityGroupRule) SetSecurityGroupId(v BaseSecurityGroupRuleGetSecurityGroupIdRetType) { + setBaseSecurityGroupRuleGetSecurityGroupIdAttributeType(&o.SecurityGroupId, v) } func (o BaseSecurityGroupRule) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getBaseSecurityGroupRuleGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getBaseSecurityGroupRuleGetDirectionAttributeTypeOk(o.Direction); ok { + toSerialize["Direction"] = val } - toSerialize["direction"] = o.Direction - if !IsNil(o.Ethertype) { - toSerialize["ethertype"] = o.Ethertype + if val, ok := getBaseSecurityGroupRuleGetEthertypeAttributeTypeOk(o.Ethertype); ok { + toSerialize["Ethertype"] = val } - if !IsNil(o.IcmpParameters) { - toSerialize["icmpParameters"] = o.IcmpParameters + if val, ok := getBaseSecurityGroupRuleGetIcmpParametersAttributeTypeOk(o.IcmpParameters); ok { + toSerialize["IcmpParameters"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getBaseSecurityGroupRuleGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.IpRange) { - toSerialize["ipRange"] = o.IpRange + if val, ok := getBaseSecurityGroupRuleGetIpRangeAttributeTypeOk(o.IpRange); ok { + toSerialize["IpRange"] = val } - if !IsNil(o.PortRange) { - toSerialize["portRange"] = o.PortRange + if val, ok := getBaseSecurityGroupRuleGetPortRangeAttributeTypeOk(o.PortRange); ok { + toSerialize["PortRange"] = val } - if !IsNil(o.RemoteSecurityGroupId) { - toSerialize["remoteSecurityGroupId"] = o.RemoteSecurityGroupId + if val, ok := getBaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeTypeOk(o.RemoteSecurityGroupId); ok { + toSerialize["RemoteSecurityGroupId"] = val } - if !IsNil(o.SecurityGroupId) { - toSerialize["securityGroupId"] = o.SecurityGroupId + if val, ok := getBaseSecurityGroupRuleGetSecurityGroupIdAttributeTypeOk(o.SecurityGroupId); ok { + toSerialize["SecurityGroupId"] = val } return toSerialize, nil } diff --git a/services/iaas/model_boot_volume.go b/services/iaas/model_boot_volume.go index b883774ee..c4140dc06 100644 --- a/services/iaas/model_boot_volume.go +++ b/services/iaas/model_boot_volume.go @@ -17,17 +17,119 @@ import ( // checks if the BootVolume type satisfies the MappedNullable interface at compile time var _ MappedNullable = &BootVolume{} +/* + types and functions for deleteOnTermination +*/ + +// isBoolean +type BootVolumegetDeleteOnTerminationAttributeType = *bool +type BootVolumegetDeleteOnTerminationArgType = bool +type BootVolumegetDeleteOnTerminationRetType = bool + +func getBootVolumegetDeleteOnTerminationAttributeTypeOk(arg BootVolumegetDeleteOnTerminationAttributeType) (ret BootVolumegetDeleteOnTerminationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBootVolumegetDeleteOnTerminationAttributeType(arg *BootVolumegetDeleteOnTerminationAttributeType, val BootVolumegetDeleteOnTerminationRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type BootVolumeGetIdAttributeType = *string + +func getBootVolumeGetIdAttributeTypeOk(arg BootVolumeGetIdAttributeType) (ret BootVolumeGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBootVolumeGetIdAttributeType(arg *BootVolumeGetIdAttributeType, val BootVolumeGetIdRetType) { + *arg = &val +} + +type BootVolumeGetIdArgType = string +type BootVolumeGetIdRetType = string + +/* + types and functions for performanceClass +*/ + +// isNotNullableString +type BootVolumeGetPerformanceClassAttributeType = *string + +func getBootVolumeGetPerformanceClassAttributeTypeOk(arg BootVolumeGetPerformanceClassAttributeType) (ret BootVolumeGetPerformanceClassRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBootVolumeGetPerformanceClassAttributeType(arg *BootVolumeGetPerformanceClassAttributeType, val BootVolumeGetPerformanceClassRetType) { + *arg = &val +} + +type BootVolumeGetPerformanceClassArgType = string +type BootVolumeGetPerformanceClassRetType = string + +/* + types and functions for size +*/ + +// isLong +type BootVolumeGetSizeAttributeType = *int64 +type BootVolumeGetSizeArgType = int64 +type BootVolumeGetSizeRetType = int64 + +func getBootVolumeGetSizeAttributeTypeOk(arg BootVolumeGetSizeAttributeType) (ret BootVolumeGetSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBootVolumeGetSizeAttributeType(arg *BootVolumeGetSizeAttributeType, val BootVolumeGetSizeRetType) { + *arg = &val +} + +/* + types and functions for source +*/ + +// isModel +type BootVolumeGetSourceAttributeType = *BootVolumeSource +type BootVolumeGetSourceArgType = BootVolumeSource +type BootVolumeGetSourceRetType = BootVolumeSource + +func getBootVolumeGetSourceAttributeTypeOk(arg BootVolumeGetSourceAttributeType) (ret BootVolumeGetSourceRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBootVolumeGetSourceAttributeType(arg *BootVolumeGetSourceAttributeType, val BootVolumeGetSourceRetType) { + *arg = &val +} + // BootVolume The boot device for the server. type BootVolume struct { // Delete the volume during the termination of the server. Defaults to false. - DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` + DeleteOnTermination BootVolumegetDeleteOnTerminationAttributeType `json:"deleteOnTermination,omitempty"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id BootVolumeGetIdAttributeType `json:"id,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - PerformanceClass *string `json:"performanceClass,omitempty"` + PerformanceClass BootVolumeGetPerformanceClassAttributeType `json:"performanceClass,omitempty"` // Size in Gigabyte. - Size *int64 `json:"size,omitempty"` - Source *BootVolumeSource `json:"source,omitempty"` + Size BootVolumeGetSizeAttributeType `json:"size,omitempty"` + Source BootVolumeGetSourceAttributeType `json:"source,omitempty"` } // NewBootVolume instantiates a new BootVolume object @@ -48,181 +150,136 @@ func NewBootVolumeWithDefaults() *BootVolume { } // GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. -func (o *BootVolume) GetDeleteOnTermination() *bool { - if o == nil || IsNil(o.DeleteOnTermination) { - var ret *bool - return ret - } - return o.DeleteOnTermination +func (o *BootVolume) GetDeleteOnTermination() (res BootVolumegetDeleteOnTerminationRetType) { + res, _ = o.GetDeleteOnTerminationOk() + return } // GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *BootVolume) GetDeleteOnTerminationOk() (*bool, bool) { - if o == nil || IsNil(o.DeleteOnTermination) { - return nil, false - } - return o.DeleteOnTermination, true +func (o *BootVolume) GetDeleteOnTerminationOk() (ret BootVolumegetDeleteOnTerminationRetType, ok bool) { + return getBootVolumegetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination) } // HasDeleteOnTermination returns a boolean if a field has been set. func (o *BootVolume) HasDeleteOnTermination() bool { - if o != nil && !IsNil(o.DeleteOnTermination) { - return true - } - - return false + _, ok := o.GetDeleteOnTerminationOk() + return ok } // SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. -func (o *BootVolume) SetDeleteOnTermination(v *bool) { - o.DeleteOnTermination = v +func (o *BootVolume) SetDeleteOnTermination(v BootVolumegetDeleteOnTerminationRetType) { + setBootVolumegetDeleteOnTerminationAttributeType(&o.DeleteOnTermination, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *BootVolume) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *BootVolume) GetId() (res BootVolumeGetIdRetType) { + 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 *BootVolume) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *BootVolume) GetIdOk() (ret BootVolumeGetIdRetType, ok bool) { + return getBootVolumeGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *BootVolume) 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 *BootVolume) SetId(v *string) { - o.Id = v +func (o *BootVolume) SetId(v BootVolumeGetIdRetType) { + setBootVolumeGetIdAttributeType(&o.Id, v) } // GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. -func (o *BootVolume) GetPerformanceClass() *string { - if o == nil || IsNil(o.PerformanceClass) { - var ret *string - return ret - } - return o.PerformanceClass +func (o *BootVolume) GetPerformanceClass() (res BootVolumeGetPerformanceClassRetType) { + res, _ = o.GetPerformanceClassOk() + return } // GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *BootVolume) GetPerformanceClassOk() (*string, bool) { - if o == nil || IsNil(o.PerformanceClass) { - return nil, false - } - return o.PerformanceClass, true +func (o *BootVolume) GetPerformanceClassOk() (ret BootVolumeGetPerformanceClassRetType, ok bool) { + return getBootVolumeGetPerformanceClassAttributeTypeOk(o.PerformanceClass) } // HasPerformanceClass returns a boolean if a field has been set. func (o *BootVolume) HasPerformanceClass() bool { - if o != nil && !IsNil(o.PerformanceClass) { - return true - } - - return false + _, ok := o.GetPerformanceClassOk() + return ok } // SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. -func (o *BootVolume) SetPerformanceClass(v *string) { - o.PerformanceClass = v +func (o *BootVolume) SetPerformanceClass(v BootVolumeGetPerformanceClassRetType) { + setBootVolumeGetPerformanceClassAttributeType(&o.PerformanceClass, v) } // GetSize returns the Size field value if set, zero value otherwise. -func (o *BootVolume) GetSize() *int64 { - if o == nil || IsNil(o.Size) { - var ret *int64 - return ret - } - return o.Size +func (o *BootVolume) GetSize() (res BootVolumeGetSizeRetType) { + 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 *BootVolume) GetSizeOk() (*int64, bool) { - if o == nil || IsNil(o.Size) { - return nil, false - } - return o.Size, true +func (o *BootVolume) GetSizeOk() (ret BootVolumeGetSizeRetType, ok bool) { + return getBootVolumeGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. func (o *BootVolume) 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 *BootVolume) SetSize(v *int64) { - o.Size = v +func (o *BootVolume) SetSize(v BootVolumeGetSizeRetType) { + setBootVolumeGetSizeAttributeType(&o.Size, v) } // GetSource returns the Source field value if set, zero value otherwise. -func (o *BootVolume) GetSource() *BootVolumeSource { - if o == nil || IsNil(o.Source) { - var ret *BootVolumeSource - return ret - } - return o.Source +func (o *BootVolume) GetSource() (res BootVolumeGetSourceRetType) { + res, _ = o.GetSourceOk() + return } // GetSourceOk returns a tuple with the Source field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *BootVolume) GetSourceOk() (*BootVolumeSource, bool) { - if o == nil || IsNil(o.Source) { - return nil, false - } - return o.Source, true +func (o *BootVolume) GetSourceOk() (ret BootVolumeGetSourceRetType, ok bool) { + return getBootVolumeGetSourceAttributeTypeOk(o.Source) } // HasSource returns a boolean if a field has been set. func (o *BootVolume) HasSource() bool { - if o != nil && !IsNil(o.Source) { - return true - } - - return false + _, ok := o.GetSourceOk() + return ok } // SetSource gets a reference to the given BootVolumeSource and assigns it to the Source field. -func (o *BootVolume) SetSource(v *BootVolumeSource) { - o.Source = v +func (o *BootVolume) SetSource(v BootVolumeGetSourceRetType) { + setBootVolumeGetSourceAttributeType(&o.Source, v) } func (o BootVolume) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.DeleteOnTermination) { - toSerialize["deleteOnTermination"] = o.DeleteOnTermination + if val, ok := getBootVolumegetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination); ok { + toSerialize["DeleteOnTermination"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getBootVolumeGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.PerformanceClass) { - toSerialize["performanceClass"] = o.PerformanceClass + if val, ok := getBootVolumeGetPerformanceClassAttributeTypeOk(o.PerformanceClass); ok { + toSerialize["PerformanceClass"] = val } - if !IsNil(o.Size) { - toSerialize["size"] = o.Size + if val, ok := getBootVolumeGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val } - if !IsNil(o.Source) { - toSerialize["source"] = o.Source + if val, ok := getBootVolumeGetSourceAttributeTypeOk(o.Source); ok { + toSerialize["Source"] = val } return toSerialize, nil } diff --git a/services/iaas/model_boot_volume_source.go b/services/iaas/model_boot_volume_source.go index a05088ee4..3012619b7 100644 --- a/services/iaas/model_boot_volume_source.go +++ b/services/iaas/model_boot_volume_source.go @@ -17,14 +17,56 @@ import ( // checks if the BootVolumeSource type satisfies the MappedNullable interface at compile time var _ MappedNullable = &BootVolumeSource{} +/* + types and functions for id +*/ + +// isNotNullableString +type BootVolumeSourceGetIdAttributeType = *string + +func getBootVolumeSourceGetIdAttributeTypeOk(arg BootVolumeSourceGetIdAttributeType) (ret BootVolumeSourceGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBootVolumeSourceGetIdAttributeType(arg *BootVolumeSourceGetIdAttributeType, val BootVolumeSourceGetIdRetType) { + *arg = &val +} + +type BootVolumeSourceGetIdArgType = string +type BootVolumeSourceGetIdRetType = string + +/* + types and functions for type +*/ + +// isNotNullableString +type BootVolumeSourceGetTypeAttributeType = *string + +func getBootVolumeSourceGetTypeAttributeTypeOk(arg BootVolumeSourceGetTypeAttributeType) (ret BootVolumeSourceGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setBootVolumeSourceGetTypeAttributeType(arg *BootVolumeSourceGetTypeAttributeType, val BootVolumeSourceGetTypeRetType) { + *arg = &val +} + +type BootVolumeSourceGetTypeArgType = string +type BootVolumeSourceGetTypeRetType = string + // BootVolumeSource struct for BootVolumeSource type BootVolumeSource struct { // Universally Unique Identifier (UUID). // REQUIRED - Id *string `json:"id"` + Id BootVolumeSourceGetIdAttributeType `json:"id"` // The source types of a boot volume. Possible values: `image`, `volume`. // REQUIRED - Type *string `json:"type"` + Type BootVolumeSourceGetTypeAttributeType `json:"type"` } type _BootVolumeSource BootVolumeSource @@ -33,10 +75,10 @@ type _BootVolumeSource BootVolumeSource // 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 NewBootVolumeSource(id *string, type_ *string) *BootVolumeSource { +func NewBootVolumeSource(id BootVolumeSourceGetIdArgType, type_ BootVolumeSourceGetTypeArgType) *BootVolumeSource { this := BootVolumeSource{} - this.Id = id - this.Type = type_ + setBootVolumeSourceGetIdAttributeType(&this.Id, id) + setBootVolumeSourceGetTypeAttributeType(&this.Type, type_) return &this } @@ -49,57 +91,47 @@ func NewBootVolumeSourceWithDefaults() *BootVolumeSource { } // GetId returns the Id field value -func (o *BootVolumeSource) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - - return o.Id +func (o *BootVolumeSource) GetId() (ret BootVolumeSourceGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *BootVolumeSource) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *BootVolumeSource) GetIdOk() (ret BootVolumeSourceGetIdRetType, ok bool) { + return getBootVolumeSourceGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *BootVolumeSource) SetId(v *string) { - o.Id = v +func (o *BootVolumeSource) SetId(v BootVolumeSourceGetIdRetType) { + setBootVolumeSourceGetIdAttributeType(&o.Id, v) } // GetType returns the Type field value -func (o *BootVolumeSource) GetType() *string { - if o == nil || IsNil(o.Type) { - var ret *string - return ret - } - - return o.Type +func (o *BootVolumeSource) GetType() (ret BootVolumeSourceGetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret } // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *BootVolumeSource) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Type, true +func (o *BootVolumeSource) GetTypeOk() (ret BootVolumeSourceGetTypeRetType, ok bool) { + return getBootVolumeSourceGetTypeAttributeTypeOk(o.Type) } // SetType sets field value -func (o *BootVolumeSource) SetType(v *string) { - o.Type = v +func (o *BootVolumeSource) SetType(v BootVolumeSourceGetTypeRetType) { + setBootVolumeSourceGetTypeAttributeType(&o.Type, v) } func (o BootVolumeSource) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["type"] = o.Type + if val, ok := getBootVolumeSourceGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getBootVolumeSourceGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_create_affinity_group_payload.go b/services/iaas/model_create_affinity_group_payload.go index b51a05fd6..5875c2173 100644 --- a/services/iaas/model_create_affinity_group_payload.go +++ b/services/iaas/model_create_affinity_group_payload.go @@ -17,18 +17,101 @@ import ( // checks if the CreateAffinityGroupPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateAffinityGroupPayload{} +/* + types and functions for id +*/ + +// isNotNullableString +type CreateAffinityGroupPayloadGetIdAttributeType = *string + +func getCreateAffinityGroupPayloadGetIdAttributeTypeOk(arg CreateAffinityGroupPayloadGetIdAttributeType) (ret CreateAffinityGroupPayloadGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateAffinityGroupPayloadGetIdAttributeType(arg *CreateAffinityGroupPayloadGetIdAttributeType, val CreateAffinityGroupPayloadGetIdRetType) { + *arg = &val +} + +type CreateAffinityGroupPayloadGetIdArgType = string +type CreateAffinityGroupPayloadGetIdRetType = string + +/* + types and functions for members +*/ + +// isArray +type CreateAffinityGroupPayloadGetMembersAttributeType = *[]string +type CreateAffinityGroupPayloadGetMembersArgType = []string +type CreateAffinityGroupPayloadGetMembersRetType = []string + +func getCreateAffinityGroupPayloadGetMembersAttributeTypeOk(arg CreateAffinityGroupPayloadGetMembersAttributeType) (ret CreateAffinityGroupPayloadGetMembersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateAffinityGroupPayloadGetMembersAttributeType(arg *CreateAffinityGroupPayloadGetMembersAttributeType, val CreateAffinityGroupPayloadGetMembersRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateAffinityGroupPayloadGetNameAttributeType = *string + +func getCreateAffinityGroupPayloadGetNameAttributeTypeOk(arg CreateAffinityGroupPayloadGetNameAttributeType) (ret CreateAffinityGroupPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateAffinityGroupPayloadGetNameAttributeType(arg *CreateAffinityGroupPayloadGetNameAttributeType, val CreateAffinityGroupPayloadGetNameRetType) { + *arg = &val +} + +type CreateAffinityGroupPayloadGetNameArgType = string +type CreateAffinityGroupPayloadGetNameRetType = string + +/* + types and functions for policy +*/ + +// isNotNullableString +type CreateAffinityGroupPayloadGetPolicyAttributeType = *string + +func getCreateAffinityGroupPayloadGetPolicyAttributeTypeOk(arg CreateAffinityGroupPayloadGetPolicyAttributeType) (ret CreateAffinityGroupPayloadGetPolicyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateAffinityGroupPayloadGetPolicyAttributeType(arg *CreateAffinityGroupPayloadGetPolicyAttributeType, val CreateAffinityGroupPayloadGetPolicyRetType) { + *arg = &val +} + +type CreateAffinityGroupPayloadGetPolicyArgType = string +type CreateAffinityGroupPayloadGetPolicyRetType = string + // CreateAffinityGroupPayload Definition of an affinity group. type CreateAffinityGroupPayload struct { // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id CreateAffinityGroupPayloadGetIdAttributeType `json:"id,omitempty"` // The servers that are part of the affinity group. - Members *[]string `json:"members,omitempty"` + Members CreateAffinityGroupPayloadGetMembersAttributeType `json:"members,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED - Name *string `json:"name"` + Name CreateAffinityGroupPayloadGetNameAttributeType `json:"name"` // The affinity group policy. `hard-affinity`: All servers in this group will be hosted on the same compute node. `soft-affinity`: All servers in this group will be hosted on as few compute nodes as possible. `hard-anti-affinity`: All servers in this group will be hosted on different compute nodes. `soft-anti-affinity`: All servers in this group will be hosted on as many compute nodes as possible. Possible values: `hard-anti-affinity`, `hard-affinity`, `soft-anti-affinity`, `soft-affinity`. // REQUIRED - Policy *string `json:"policy"` + Policy CreateAffinityGroupPayloadGetPolicyAttributeType `json:"policy"` } type _CreateAffinityGroupPayload CreateAffinityGroupPayload @@ -37,10 +120,10 @@ type _CreateAffinityGroupPayload CreateAffinityGroupPayload // 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 NewCreateAffinityGroupPayload(name *string, policy *string) *CreateAffinityGroupPayload { +func NewCreateAffinityGroupPayload(name CreateAffinityGroupPayloadGetNameArgType, policy CreateAffinityGroupPayloadGetPolicyArgType) *CreateAffinityGroupPayload { this := CreateAffinityGroupPayload{} - this.Name = name - this.Policy = policy + setCreateAffinityGroupPayloadGetNameAttributeType(&this.Name, name) + setCreateAffinityGroupPayloadGetPolicyAttributeType(&this.Policy, policy) return &this } @@ -53,127 +136,99 @@ func NewCreateAffinityGroupPayloadWithDefaults() *CreateAffinityGroupPayload { } // GetId returns the Id field value if set, zero value otherwise. -func (o *CreateAffinityGroupPayload) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *CreateAffinityGroupPayload) GetId() (res CreateAffinityGroupPayloadGetIdRetType) { + 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 *CreateAffinityGroupPayload) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *CreateAffinityGroupPayload) GetIdOk() (ret CreateAffinityGroupPayloadGetIdRetType, ok bool) { + return getCreateAffinityGroupPayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *CreateAffinityGroupPayload) 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 *CreateAffinityGroupPayload) SetId(v *string) { - o.Id = v +func (o *CreateAffinityGroupPayload) SetId(v CreateAffinityGroupPayloadGetIdRetType) { + setCreateAffinityGroupPayloadGetIdAttributeType(&o.Id, v) } // GetMembers returns the Members field value if set, zero value otherwise. -func (o *CreateAffinityGroupPayload) GetMembers() *[]string { - if o == nil || IsNil(o.Members) { - var ret *[]string - return ret - } - return o.Members +func (o *CreateAffinityGroupPayload) GetMembers() (res CreateAffinityGroupPayloadGetMembersRetType) { + res, _ = o.GetMembersOk() + return } // GetMembersOk returns a tuple with the Members field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateAffinityGroupPayload) GetMembersOk() (*[]string, bool) { - if o == nil || IsNil(o.Members) { - return nil, false - } - return o.Members, true +func (o *CreateAffinityGroupPayload) GetMembersOk() (ret CreateAffinityGroupPayloadGetMembersRetType, ok bool) { + return getCreateAffinityGroupPayloadGetMembersAttributeTypeOk(o.Members) } // HasMembers returns a boolean if a field has been set. func (o *CreateAffinityGroupPayload) HasMembers() bool { - if o != nil && !IsNil(o.Members) { - return true - } - - return false + _, ok := o.GetMembersOk() + return ok } // SetMembers gets a reference to the given []string and assigns it to the Members field. -func (o *CreateAffinityGroupPayload) SetMembers(v *[]string) { - o.Members = v +func (o *CreateAffinityGroupPayload) SetMembers(v CreateAffinityGroupPayloadGetMembersRetType) { + setCreateAffinityGroupPayloadGetMembersAttributeType(&o.Members, v) } // GetName returns the Name field value -func (o *CreateAffinityGroupPayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *CreateAffinityGroupPayload) GetName() (ret CreateAffinityGroupPayloadGetNameRetType) { + 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 *CreateAffinityGroupPayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *CreateAffinityGroupPayload) GetNameOk() (ret CreateAffinityGroupPayloadGetNameRetType, ok bool) { + return getCreateAffinityGroupPayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *CreateAffinityGroupPayload) SetName(v *string) { - o.Name = v +func (o *CreateAffinityGroupPayload) SetName(v CreateAffinityGroupPayloadGetNameRetType) { + setCreateAffinityGroupPayloadGetNameAttributeType(&o.Name, v) } // GetPolicy returns the Policy field value -func (o *CreateAffinityGroupPayload) GetPolicy() *string { - if o == nil || IsNil(o.Policy) { - var ret *string - return ret - } - - return o.Policy +func (o *CreateAffinityGroupPayload) GetPolicy() (ret CreateAffinityGroupPayloadGetPolicyRetType) { + ret, _ = o.GetPolicyOk() + return ret } // GetPolicyOk returns a tuple with the Policy field value // and a boolean to check if the value has been set. -func (o *CreateAffinityGroupPayload) GetPolicyOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Policy, true +func (o *CreateAffinityGroupPayload) GetPolicyOk() (ret CreateAffinityGroupPayloadGetPolicyRetType, ok bool) { + return getCreateAffinityGroupPayloadGetPolicyAttributeTypeOk(o.Policy) } // SetPolicy sets field value -func (o *CreateAffinityGroupPayload) SetPolicy(v *string) { - o.Policy = v +func (o *CreateAffinityGroupPayload) SetPolicy(v CreateAffinityGroupPayloadGetPolicyRetType) { + setCreateAffinityGroupPayloadGetPolicyAttributeType(&o.Policy, v) } func (o CreateAffinityGroupPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getCreateAffinityGroupPayloadGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getCreateAffinityGroupPayloadGetMembersAttributeTypeOk(o.Members); ok { + toSerialize["Members"] = val + } + if val, ok := getCreateAffinityGroupPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Members) { - toSerialize["members"] = o.Members + if val, ok := getCreateAffinityGroupPayloadGetPolicyAttributeTypeOk(o.Policy); ok { + toSerialize["Policy"] = val } - toSerialize["name"] = o.Name - toSerialize["policy"] = o.Policy return toSerialize, nil } diff --git a/services/iaas/model_create_area_address_family.go b/services/iaas/model_create_area_address_family.go index 4933bf32d..a85f6cd69 100644 --- a/services/iaas/model_create_area_address_family.go +++ b/services/iaas/model_create_area_address_family.go @@ -17,9 +17,29 @@ import ( // checks if the CreateAreaAddressFamily type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateAreaAddressFamily{} +/* + types and functions for ipv4 +*/ + +// isModel +type CreateAreaAddressFamilyGetIpv4AttributeType = *CreateAreaIPv4 +type CreateAreaAddressFamilyGetIpv4ArgType = CreateAreaIPv4 +type CreateAreaAddressFamilyGetIpv4RetType = CreateAreaIPv4 + +func getCreateAreaAddressFamilyGetIpv4AttributeTypeOk(arg CreateAreaAddressFamilyGetIpv4AttributeType) (ret CreateAreaAddressFamilyGetIpv4RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateAreaAddressFamilyGetIpv4AttributeType(arg *CreateAreaAddressFamilyGetIpv4AttributeType, val CreateAreaAddressFamilyGetIpv4RetType) { + *arg = &val +} + // CreateAreaAddressFamily The addressFamily object for a area create request. type CreateAreaAddressFamily struct { - Ipv4 *CreateAreaIPv4 `json:"ipv4,omitempty"` + Ipv4 CreateAreaAddressFamilyGetIpv4AttributeType `json:"ipv4,omitempty"` } // NewCreateAreaAddressFamily instantiates a new CreateAreaAddressFamily object @@ -40,41 +60,32 @@ func NewCreateAreaAddressFamilyWithDefaults() *CreateAreaAddressFamily { } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *CreateAreaAddressFamily) GetIpv4() *CreateAreaIPv4 { - if o == nil || IsNil(o.Ipv4) { - var ret *CreateAreaIPv4 - return ret - } - return o.Ipv4 +func (o *CreateAreaAddressFamily) GetIpv4() (res CreateAreaAddressFamilyGetIpv4RetType) { + res, _ = o.GetIpv4Ok() + return } // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateAreaAddressFamily) GetIpv4Ok() (*CreateAreaIPv4, bool) { - if o == nil || IsNil(o.Ipv4) { - return nil, false - } - return o.Ipv4, true +func (o *CreateAreaAddressFamily) GetIpv4Ok() (ret CreateAreaAddressFamilyGetIpv4RetType, ok bool) { + return getCreateAreaAddressFamilyGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. func (o *CreateAreaAddressFamily) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { - return true - } - - return false + _, ok := o.GetIpv4Ok() + return ok } // SetIpv4 gets a reference to the given CreateAreaIPv4 and assigns it to the Ipv4 field. -func (o *CreateAreaAddressFamily) SetIpv4(v *CreateAreaIPv4) { - o.Ipv4 = v +func (o *CreateAreaAddressFamily) SetIpv4(v CreateAreaAddressFamilyGetIpv4RetType) { + setCreateAreaAddressFamilyGetIpv4AttributeType(&o.Ipv4, v) } func (o CreateAreaAddressFamily) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Ipv4) { - toSerialize["ipv4"] = o.Ipv4 + if val, ok := getCreateAreaAddressFamilyGetIpv4AttributeTypeOk(o.Ipv4); ok { + toSerialize["Ipv4"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_area_ipv4.go b/services/iaas/model_create_area_ipv4.go index 283430dcd..370dd9aad 100644 --- a/services/iaas/model_create_area_ipv4.go +++ b/services/iaas/model_create_area_ipv4.go @@ -17,23 +17,164 @@ import ( // checks if the CreateAreaIPv4 type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateAreaIPv4{} +/* + types and functions for defaultNameservers +*/ + +// isArray +type CreateAreaIPv4GetDefaultNameserversAttributeType = *[]string +type CreateAreaIPv4GetDefaultNameserversArgType = []string +type CreateAreaIPv4GetDefaultNameserversRetType = []string + +func getCreateAreaIPv4GetDefaultNameserversAttributeTypeOk(arg CreateAreaIPv4GetDefaultNameserversAttributeType) (ret CreateAreaIPv4GetDefaultNameserversRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateAreaIPv4GetDefaultNameserversAttributeType(arg *CreateAreaIPv4GetDefaultNameserversAttributeType, val CreateAreaIPv4GetDefaultNameserversRetType) { + *arg = &val +} + +/* + types and functions for networkRanges +*/ + +// isArray +type CreateAreaIPv4GetNetworkRangesAttributeType = *[]NetworkRange +type CreateAreaIPv4GetNetworkRangesArgType = []NetworkRange +type CreateAreaIPv4GetNetworkRangesRetType = []NetworkRange + +func getCreateAreaIPv4GetNetworkRangesAttributeTypeOk(arg CreateAreaIPv4GetNetworkRangesAttributeType) (ret CreateAreaIPv4GetNetworkRangesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateAreaIPv4GetNetworkRangesAttributeType(arg *CreateAreaIPv4GetNetworkRangesAttributeType, val CreateAreaIPv4GetNetworkRangesRetType) { + *arg = &val +} + +/* + types and functions for routes +*/ + +// isArray +type CreateAreaIPv4GetRoutesAttributeType = *[]Route +type CreateAreaIPv4GetRoutesArgType = []Route +type CreateAreaIPv4GetRoutesRetType = []Route + +func getCreateAreaIPv4GetRoutesAttributeTypeOk(arg CreateAreaIPv4GetRoutesAttributeType) (ret CreateAreaIPv4GetRoutesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateAreaIPv4GetRoutesAttributeType(arg *CreateAreaIPv4GetRoutesAttributeType, val CreateAreaIPv4GetRoutesRetType) { + *arg = &val +} + +/* + types and functions for transferNetwork +*/ + +// isNotNullableString +type CreateAreaIPv4GetTransferNetworkAttributeType = *string + +func getCreateAreaIPv4GetTransferNetworkAttributeTypeOk(arg CreateAreaIPv4GetTransferNetworkAttributeType) (ret CreateAreaIPv4GetTransferNetworkRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateAreaIPv4GetTransferNetworkAttributeType(arg *CreateAreaIPv4GetTransferNetworkAttributeType, val CreateAreaIPv4GetTransferNetworkRetType) { + *arg = &val +} + +type CreateAreaIPv4GetTransferNetworkArgType = string +type CreateAreaIPv4GetTransferNetworkRetType = string + +/* + types and functions for defaultPrefixLen +*/ + +// isInteger +type CreateAreaIPv4GetDefaultPrefixLenAttributeType = *int64 +type CreateAreaIPv4GetDefaultPrefixLenArgType = int64 +type CreateAreaIPv4GetDefaultPrefixLenRetType = int64 + +func getCreateAreaIPv4GetDefaultPrefixLenAttributeTypeOk(arg CreateAreaIPv4GetDefaultPrefixLenAttributeType) (ret CreateAreaIPv4GetDefaultPrefixLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateAreaIPv4GetDefaultPrefixLenAttributeType(arg *CreateAreaIPv4GetDefaultPrefixLenAttributeType, val CreateAreaIPv4GetDefaultPrefixLenRetType) { + *arg = &val +} + +/* + types and functions for maxPrefixLen +*/ + +// isInteger +type CreateAreaIPv4GetMaxPrefixLenAttributeType = *int64 +type CreateAreaIPv4GetMaxPrefixLenArgType = int64 +type CreateAreaIPv4GetMaxPrefixLenRetType = int64 + +func getCreateAreaIPv4GetMaxPrefixLenAttributeTypeOk(arg CreateAreaIPv4GetMaxPrefixLenAttributeType) (ret CreateAreaIPv4GetMaxPrefixLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateAreaIPv4GetMaxPrefixLenAttributeType(arg *CreateAreaIPv4GetMaxPrefixLenAttributeType, val CreateAreaIPv4GetMaxPrefixLenRetType) { + *arg = &val +} + +/* + types and functions for minPrefixLen +*/ + +// isInteger +type CreateAreaIPv4GetMinPrefixLenAttributeType = *int64 +type CreateAreaIPv4GetMinPrefixLenArgType = int64 +type CreateAreaIPv4GetMinPrefixLenRetType = int64 + +func getCreateAreaIPv4GetMinPrefixLenAttributeTypeOk(arg CreateAreaIPv4GetMinPrefixLenAttributeType) (ret CreateAreaIPv4GetMinPrefixLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateAreaIPv4GetMinPrefixLenAttributeType(arg *CreateAreaIPv4GetMinPrefixLenAttributeType, val CreateAreaIPv4GetMinPrefixLenRetType) { + *arg = &val +} + // CreateAreaIPv4 The config object for a IPv4 network area. type CreateAreaIPv4 struct { - DefaultNameservers *[]string `json:"defaultNameservers,omitempty"` + DefaultNameservers CreateAreaIPv4GetDefaultNameserversAttributeType `json:"defaultNameservers,omitempty"` // A list of network ranges. // REQUIRED - NetworkRanges *[]NetworkRange `json:"networkRanges"` + NetworkRanges CreateAreaIPv4GetNetworkRangesAttributeType `json:"networkRanges"` // A list of routes. - Routes *[]Route `json:"routes,omitempty"` + Routes CreateAreaIPv4GetRoutesAttributeType `json:"routes,omitempty"` // Classless Inter-Domain Routing (CIDR). // REQUIRED - TransferNetwork *string `json:"transferNetwork"` + TransferNetwork CreateAreaIPv4GetTransferNetworkAttributeType `json:"transferNetwork"` // The default prefix length for networks in the network area. - DefaultPrefixLen *int64 `json:"defaultPrefixLen,omitempty"` + DefaultPrefixLen CreateAreaIPv4GetDefaultPrefixLenAttributeType `json:"defaultPrefixLen,omitempty"` // The maximal prefix length for networks in the network area. - MaxPrefixLen *int64 `json:"maxPrefixLen,omitempty"` + MaxPrefixLen CreateAreaIPv4GetMaxPrefixLenAttributeType `json:"maxPrefixLen,omitempty"` // The minimal prefix length for networks in the network area. - MinPrefixLen *int64 `json:"minPrefixLen,omitempty"` + MinPrefixLen CreateAreaIPv4GetMinPrefixLenAttributeType `json:"minPrefixLen,omitempty"` } type _CreateAreaIPv4 CreateAreaIPv4 @@ -42,16 +183,10 @@ type _CreateAreaIPv4 CreateAreaIPv4 // 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 NewCreateAreaIPv4(networkRanges *[]NetworkRange, transferNetwork *string) *CreateAreaIPv4 { +func NewCreateAreaIPv4(networkRanges CreateAreaIPv4GetNetworkRangesArgType, transferNetwork CreateAreaIPv4GetTransferNetworkArgType) *CreateAreaIPv4 { this := CreateAreaIPv4{} - this.NetworkRanges = networkRanges - this.TransferNetwork = transferNetwork - var defaultPrefixLen int64 = 25 - this.DefaultPrefixLen = &defaultPrefixLen - var maxPrefixLen int64 = 29 - this.MaxPrefixLen = &maxPrefixLen - var minPrefixLen int64 = 24 - this.MinPrefixLen = &minPrefixLen + setCreateAreaIPv4GetNetworkRangesAttributeType(&this.NetworkRanges, networkRanges) + setCreateAreaIPv4GetTransferNetworkAttributeType(&this.TransferNetwork, transferNetwork) return &this } @@ -70,231 +205,176 @@ func NewCreateAreaIPv4WithDefaults() *CreateAreaIPv4 { } // GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. -func (o *CreateAreaIPv4) GetDefaultNameservers() *[]string { - if o == nil || IsNil(o.DefaultNameservers) { - var ret *[]string - return ret - } - return o.DefaultNameservers +func (o *CreateAreaIPv4) GetDefaultNameservers() (res CreateAreaIPv4GetDefaultNameserversRetType) { + res, _ = o.GetDefaultNameserversOk() + return } // GetDefaultNameserversOk returns a tuple with the DefaultNameservers field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateAreaIPv4) GetDefaultNameserversOk() (*[]string, bool) { - if o == nil || IsNil(o.DefaultNameservers) { - return nil, false - } - return o.DefaultNameservers, true +func (o *CreateAreaIPv4) GetDefaultNameserversOk() (ret CreateAreaIPv4GetDefaultNameserversRetType, ok bool) { + return getCreateAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers) } // HasDefaultNameservers returns a boolean if a field has been set. func (o *CreateAreaIPv4) HasDefaultNameservers() bool { - if o != nil && !IsNil(o.DefaultNameservers) { - return true - } - - return false + _, ok := o.GetDefaultNameserversOk() + return ok } // SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. -func (o *CreateAreaIPv4) SetDefaultNameservers(v *[]string) { - o.DefaultNameservers = v +func (o *CreateAreaIPv4) SetDefaultNameservers(v CreateAreaIPv4GetDefaultNameserversRetType) { + setCreateAreaIPv4GetDefaultNameserversAttributeType(&o.DefaultNameservers, v) } // GetNetworkRanges returns the NetworkRanges field value -func (o *CreateAreaIPv4) GetNetworkRanges() *[]NetworkRange { - if o == nil || IsNil(o.NetworkRanges) { - var ret *[]NetworkRange - return ret - } - - return o.NetworkRanges +func (o *CreateAreaIPv4) GetNetworkRanges() (ret CreateAreaIPv4GetNetworkRangesRetType) { + ret, _ = o.GetNetworkRangesOk() + return ret } // GetNetworkRangesOk returns a tuple with the NetworkRanges field value // and a boolean to check if the value has been set. -func (o *CreateAreaIPv4) GetNetworkRangesOk() (*[]NetworkRange, bool) { - if o == nil { - return nil, false - } - return o.NetworkRanges, true +func (o *CreateAreaIPv4) GetNetworkRangesOk() (ret CreateAreaIPv4GetNetworkRangesRetType, ok bool) { + return getCreateAreaIPv4GetNetworkRangesAttributeTypeOk(o.NetworkRanges) } // SetNetworkRanges sets field value -func (o *CreateAreaIPv4) SetNetworkRanges(v *[]NetworkRange) { - o.NetworkRanges = v +func (o *CreateAreaIPv4) SetNetworkRanges(v CreateAreaIPv4GetNetworkRangesRetType) { + setCreateAreaIPv4GetNetworkRangesAttributeType(&o.NetworkRanges, v) } // GetRoutes returns the Routes field value if set, zero value otherwise. -func (o *CreateAreaIPv4) GetRoutes() *[]Route { - if o == nil || IsNil(o.Routes) { - var ret *[]Route - return ret - } - return o.Routes +func (o *CreateAreaIPv4) GetRoutes() (res CreateAreaIPv4GetRoutesRetType) { + res, _ = o.GetRoutesOk() + return } // GetRoutesOk returns a tuple with the Routes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateAreaIPv4) GetRoutesOk() (*[]Route, bool) { - if o == nil || IsNil(o.Routes) { - return nil, false - } - return o.Routes, true +func (o *CreateAreaIPv4) GetRoutesOk() (ret CreateAreaIPv4GetRoutesRetType, ok bool) { + return getCreateAreaIPv4GetRoutesAttributeTypeOk(o.Routes) } // HasRoutes returns a boolean if a field has been set. func (o *CreateAreaIPv4) HasRoutes() bool { - if o != nil && !IsNil(o.Routes) { - return true - } - - return false + _, ok := o.GetRoutesOk() + return ok } // SetRoutes gets a reference to the given []Route and assigns it to the Routes field. -func (o *CreateAreaIPv4) SetRoutes(v *[]Route) { - o.Routes = v +func (o *CreateAreaIPv4) SetRoutes(v CreateAreaIPv4GetRoutesRetType) { + setCreateAreaIPv4GetRoutesAttributeType(&o.Routes, v) } // GetTransferNetwork returns the TransferNetwork field value -func (o *CreateAreaIPv4) GetTransferNetwork() *string { - if o == nil || IsNil(o.TransferNetwork) { - var ret *string - return ret - } - - return o.TransferNetwork +func (o *CreateAreaIPv4) GetTransferNetwork() (ret CreateAreaIPv4GetTransferNetworkRetType) { + ret, _ = o.GetTransferNetworkOk() + return ret } // GetTransferNetworkOk returns a tuple with the TransferNetwork field value // and a boolean to check if the value has been set. -func (o *CreateAreaIPv4) GetTransferNetworkOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.TransferNetwork, true +func (o *CreateAreaIPv4) GetTransferNetworkOk() (ret CreateAreaIPv4GetTransferNetworkRetType, ok bool) { + return getCreateAreaIPv4GetTransferNetworkAttributeTypeOk(o.TransferNetwork) } // SetTransferNetwork sets field value -func (o *CreateAreaIPv4) SetTransferNetwork(v *string) { - o.TransferNetwork = v +func (o *CreateAreaIPv4) SetTransferNetwork(v CreateAreaIPv4GetTransferNetworkRetType) { + setCreateAreaIPv4GetTransferNetworkAttributeType(&o.TransferNetwork, v) } // GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. -func (o *CreateAreaIPv4) GetDefaultPrefixLen() *int64 { - if o == nil || IsNil(o.DefaultPrefixLen) { - var ret *int64 - return ret - } - return o.DefaultPrefixLen +func (o *CreateAreaIPv4) GetDefaultPrefixLen() (res CreateAreaIPv4GetDefaultPrefixLenRetType) { + res, _ = o.GetDefaultPrefixLenOk() + return } // GetDefaultPrefixLenOk returns a tuple with the DefaultPrefixLen field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateAreaIPv4) GetDefaultPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.DefaultPrefixLen) { - return nil, false - } - return o.DefaultPrefixLen, true +func (o *CreateAreaIPv4) GetDefaultPrefixLenOk() (ret CreateAreaIPv4GetDefaultPrefixLenRetType, ok bool) { + return getCreateAreaIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen) } // HasDefaultPrefixLen returns a boolean if a field has been set. func (o *CreateAreaIPv4) HasDefaultPrefixLen() bool { - if o != nil && !IsNil(o.DefaultPrefixLen) { - return true - } - - return false + _, ok := o.GetDefaultPrefixLenOk() + return ok } // SetDefaultPrefixLen gets a reference to the given int64 and assigns it to the DefaultPrefixLen field. -func (o *CreateAreaIPv4) SetDefaultPrefixLen(v *int64) { - o.DefaultPrefixLen = v +func (o *CreateAreaIPv4) SetDefaultPrefixLen(v CreateAreaIPv4GetDefaultPrefixLenRetType) { + setCreateAreaIPv4GetDefaultPrefixLenAttributeType(&o.DefaultPrefixLen, v) } // GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. -func (o *CreateAreaIPv4) GetMaxPrefixLen() *int64 { - if o == nil || IsNil(o.MaxPrefixLen) { - var ret *int64 - return ret - } - return o.MaxPrefixLen +func (o *CreateAreaIPv4) GetMaxPrefixLen() (res CreateAreaIPv4GetMaxPrefixLenRetType) { + res, _ = o.GetMaxPrefixLenOk() + return } // GetMaxPrefixLenOk returns a tuple with the MaxPrefixLen field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateAreaIPv4) GetMaxPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MaxPrefixLen) { - return nil, false - } - return o.MaxPrefixLen, true +func (o *CreateAreaIPv4) GetMaxPrefixLenOk() (ret CreateAreaIPv4GetMaxPrefixLenRetType, ok bool) { + return getCreateAreaIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen) } // HasMaxPrefixLen returns a boolean if a field has been set. func (o *CreateAreaIPv4) HasMaxPrefixLen() bool { - if o != nil && !IsNil(o.MaxPrefixLen) { - return true - } - - return false + _, ok := o.GetMaxPrefixLenOk() + return ok } // SetMaxPrefixLen gets a reference to the given int64 and assigns it to the MaxPrefixLen field. -func (o *CreateAreaIPv4) SetMaxPrefixLen(v *int64) { - o.MaxPrefixLen = v +func (o *CreateAreaIPv4) SetMaxPrefixLen(v CreateAreaIPv4GetMaxPrefixLenRetType) { + setCreateAreaIPv4GetMaxPrefixLenAttributeType(&o.MaxPrefixLen, v) } // GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. -func (o *CreateAreaIPv4) GetMinPrefixLen() *int64 { - if o == nil || IsNil(o.MinPrefixLen) { - var ret *int64 - return ret - } - return o.MinPrefixLen +func (o *CreateAreaIPv4) GetMinPrefixLen() (res CreateAreaIPv4GetMinPrefixLenRetType) { + res, _ = o.GetMinPrefixLenOk() + return } // GetMinPrefixLenOk returns a tuple with the MinPrefixLen field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateAreaIPv4) GetMinPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MinPrefixLen) { - return nil, false - } - return o.MinPrefixLen, true +func (o *CreateAreaIPv4) GetMinPrefixLenOk() (ret CreateAreaIPv4GetMinPrefixLenRetType, ok bool) { + return getCreateAreaIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen) } // HasMinPrefixLen returns a boolean if a field has been set. func (o *CreateAreaIPv4) HasMinPrefixLen() bool { - if o != nil && !IsNil(o.MinPrefixLen) { - return true - } - - return false + _, ok := o.GetMinPrefixLenOk() + return ok } // SetMinPrefixLen gets a reference to the given int64 and assigns it to the MinPrefixLen field. -func (o *CreateAreaIPv4) SetMinPrefixLen(v *int64) { - o.MinPrefixLen = v +func (o *CreateAreaIPv4) SetMinPrefixLen(v CreateAreaIPv4GetMinPrefixLenRetType) { + setCreateAreaIPv4GetMinPrefixLenAttributeType(&o.MinPrefixLen, v) } func (o CreateAreaIPv4) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.DefaultNameservers) { - toSerialize["defaultNameservers"] = o.DefaultNameservers + if val, ok := getCreateAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers); ok { + toSerialize["DefaultNameservers"] = val + } + if val, ok := getCreateAreaIPv4GetNetworkRangesAttributeTypeOk(o.NetworkRanges); ok { + toSerialize["NetworkRanges"] = val + } + if val, ok := getCreateAreaIPv4GetRoutesAttributeTypeOk(o.Routes); ok { + toSerialize["Routes"] = val } - toSerialize["networkRanges"] = o.NetworkRanges - if !IsNil(o.Routes) { - toSerialize["routes"] = o.Routes + if val, ok := getCreateAreaIPv4GetTransferNetworkAttributeTypeOk(o.TransferNetwork); ok { + toSerialize["TransferNetwork"] = val } - toSerialize["transferNetwork"] = o.TransferNetwork - if !IsNil(o.DefaultPrefixLen) { - toSerialize["defaultPrefixLen"] = o.DefaultPrefixLen + if val, ok := getCreateAreaIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen); ok { + toSerialize["DefaultPrefixLen"] = val } - if !IsNil(o.MaxPrefixLen) { - toSerialize["maxPrefixLen"] = o.MaxPrefixLen + if val, ok := getCreateAreaIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen); ok { + toSerialize["MaxPrefixLen"] = val } - if !IsNil(o.MinPrefixLen) { - toSerialize["minPrefixLen"] = o.MinPrefixLen + if val, ok := getCreateAreaIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen); ok { + toSerialize["MinPrefixLen"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_backup_payload.go b/services/iaas/model_create_backup_payload.go index b3b401bce..f6413e8c6 100644 --- a/services/iaas/model_create_backup_payload.go +++ b/services/iaas/model_create_backup_payload.go @@ -17,14 +17,75 @@ import ( // checks if the CreateBackupPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateBackupPayload{} +/* + types and functions for labels +*/ + +// isFreeform +type CreateBackupPayloadGetLabelsAttributeType = *map[string]interface{} +type CreateBackupPayloadGetLabelsArgType = map[string]interface{} +type CreateBackupPayloadGetLabelsRetType = map[string]interface{} + +func getCreateBackupPayloadGetLabelsAttributeTypeOk(arg CreateBackupPayloadGetLabelsAttributeType) (ret CreateBackupPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateBackupPayloadGetLabelsAttributeType(arg *CreateBackupPayloadGetLabelsAttributeType, val CreateBackupPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateBackupPayloadGetNameAttributeType = *string + +func getCreateBackupPayloadGetNameAttributeTypeOk(arg CreateBackupPayloadGetNameAttributeType) (ret CreateBackupPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateBackupPayloadGetNameAttributeType(arg *CreateBackupPayloadGetNameAttributeType, val CreateBackupPayloadGetNameRetType) { + *arg = &val +} + +type CreateBackupPayloadGetNameArgType = string +type CreateBackupPayloadGetNameRetType = string + +/* + types and functions for source +*/ + +// isModel +type CreateBackupPayloadGetSourceAttributeType = *BackupSource +type CreateBackupPayloadGetSourceArgType = BackupSource +type CreateBackupPayloadGetSourceRetType = BackupSource + +func getCreateBackupPayloadGetSourceAttributeTypeOk(arg CreateBackupPayloadGetSourceAttributeType) (ret CreateBackupPayloadGetSourceRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateBackupPayloadGetSourceAttributeType(arg *CreateBackupPayloadGetSourceAttributeType, val CreateBackupPayloadGetSourceRetType) { + *arg = &val +} + // CreateBackupPayload Object that represents a backup create request body. type CreateBackupPayload struct { // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels CreateBackupPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty"` + Name CreateBackupPayloadGetNameAttributeType `json:"name,omitempty"` // REQUIRED - Source *BackupSource `json:"source"` + Source CreateBackupPayloadGetSourceAttributeType `json:"source"` } type _CreateBackupPayload CreateBackupPayload @@ -33,9 +94,9 @@ type _CreateBackupPayload CreateBackupPayload // 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 NewCreateBackupPayload(source *BackupSource) *CreateBackupPayload { +func NewCreateBackupPayload(source CreateBackupPayloadGetSourceArgType) *CreateBackupPayload { this := CreateBackupPayload{} - this.Source = source + setCreateBackupPayloadGetSourceAttributeType(&this.Source, source) return &this } @@ -48,102 +109,79 @@ func NewCreateBackupPayloadWithDefaults() *CreateBackupPayload { } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateBackupPayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *CreateBackupPayload) GetLabels() (res CreateBackupPayloadGetLabelsRetType) { + 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 *CreateBackupPayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *CreateBackupPayload) GetLabelsOk() (ret CreateBackupPayloadGetLabelsRetType, ok bool) { + return getCreateBackupPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *CreateBackupPayload) 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 *CreateBackupPayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *CreateBackupPayload) SetLabels(v CreateBackupPayloadGetLabelsRetType) { + setCreateBackupPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *CreateBackupPayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *CreateBackupPayload) GetName() (res CreateBackupPayloadGetNameRetType) { + 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 *CreateBackupPayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *CreateBackupPayload) GetNameOk() (ret CreateBackupPayloadGetNameRetType, ok bool) { + return getCreateBackupPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *CreateBackupPayload) 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 *CreateBackupPayload) SetName(v *string) { - o.Name = v +func (o *CreateBackupPayload) SetName(v CreateBackupPayloadGetNameRetType) { + setCreateBackupPayloadGetNameAttributeType(&o.Name, v) } // GetSource returns the Source field value -func (o *CreateBackupPayload) GetSource() *BackupSource { - if o == nil || IsNil(o.Source) { - var ret *BackupSource - return ret - } - - return o.Source +func (o *CreateBackupPayload) GetSource() (ret CreateBackupPayloadGetSourceRetType) { + ret, _ = o.GetSourceOk() + return ret } // GetSourceOk returns a tuple with the Source field value // and a boolean to check if the value has been set. -func (o *CreateBackupPayload) GetSourceOk() (*BackupSource, bool) { - if o == nil { - return nil, false - } - return o.Source, true +func (o *CreateBackupPayload) GetSourceOk() (ret CreateBackupPayloadGetSourceRetType, ok bool) { + return getCreateBackupPayloadGetSourceAttributeTypeOk(o.Source) } // SetSource sets field value -func (o *CreateBackupPayload) SetSource(v *BackupSource) { - o.Source = v +func (o *CreateBackupPayload) SetSource(v CreateBackupPayloadGetSourceRetType) { + setCreateBackupPayloadGetSourceAttributeType(&o.Source, v) } func (o CreateBackupPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getCreateBackupPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getCreateBackupPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getCreateBackupPayloadGetSourceAttributeTypeOk(o.Source); ok { + toSerialize["Source"] = val } - toSerialize["source"] = o.Source return toSerialize, nil } diff --git a/services/iaas/model_create_image_payload.go b/services/iaas/model_create_image_payload.go index f2eae6970..29b708dce 100644 --- a/services/iaas/model_create_image_payload.go +++ b/services/iaas/model_create_image_payload.go @@ -18,37 +18,343 @@ import ( // checks if the CreateImagePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateImagePayload{} +/* + types and functions for checksum +*/ + +// isModel +type CreateImagePayloadGetChecksumAttributeType = *ImageChecksum +type CreateImagePayloadGetChecksumArgType = ImageChecksum +type CreateImagePayloadGetChecksumRetType = ImageChecksum + +func getCreateImagePayloadGetChecksumAttributeTypeOk(arg CreateImagePayloadGetChecksumAttributeType) (ret CreateImagePayloadGetChecksumRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateImagePayloadGetChecksumAttributeType(arg *CreateImagePayloadGetChecksumAttributeType, val CreateImagePayloadGetChecksumRetType) { + *arg = &val +} + +/* + types and functions for config +*/ + +// isModel +type CreateImagePayloadGetConfigAttributeType = *ImageConfig +type CreateImagePayloadGetConfigArgType = ImageConfig +type CreateImagePayloadGetConfigRetType = ImageConfig + +func getCreateImagePayloadGetConfigAttributeTypeOk(arg CreateImagePayloadGetConfigAttributeType) (ret CreateImagePayloadGetConfigRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateImagePayloadGetConfigAttributeType(arg *CreateImagePayloadGetConfigAttributeType, val CreateImagePayloadGetConfigRetType) { + *arg = &val +} + +/* + types and functions for createdAt +*/ + +// isDateTime +type CreateImagePayloadGetCreatedAtAttributeType = *time.Time +type CreateImagePayloadGetCreatedAtArgType = time.Time +type CreateImagePayloadGetCreatedAtRetType = time.Time + +func getCreateImagePayloadGetCreatedAtAttributeTypeOk(arg CreateImagePayloadGetCreatedAtAttributeType) (ret CreateImagePayloadGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateImagePayloadGetCreatedAtAttributeType(arg *CreateImagePayloadGetCreatedAtAttributeType, val CreateImagePayloadGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for diskFormat +*/ + +// isNotNullableString +type CreateImagePayloadGetDiskFormatAttributeType = *string + +func getCreateImagePayloadGetDiskFormatAttributeTypeOk(arg CreateImagePayloadGetDiskFormatAttributeType) (ret CreateImagePayloadGetDiskFormatRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateImagePayloadGetDiskFormatAttributeType(arg *CreateImagePayloadGetDiskFormatAttributeType, val CreateImagePayloadGetDiskFormatRetType) { + *arg = &val +} + +type CreateImagePayloadGetDiskFormatArgType = string +type CreateImagePayloadGetDiskFormatRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type CreateImagePayloadGetIdAttributeType = *string + +func getCreateImagePayloadGetIdAttributeTypeOk(arg CreateImagePayloadGetIdAttributeType) (ret CreateImagePayloadGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateImagePayloadGetIdAttributeType(arg *CreateImagePayloadGetIdAttributeType, val CreateImagePayloadGetIdRetType) { + *arg = &val +} + +type CreateImagePayloadGetIdArgType = string +type CreateImagePayloadGetIdRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type CreateImagePayloadGetLabelsAttributeType = *map[string]interface{} +type CreateImagePayloadGetLabelsArgType = map[string]interface{} +type CreateImagePayloadGetLabelsRetType = map[string]interface{} + +func getCreateImagePayloadGetLabelsAttributeTypeOk(arg CreateImagePayloadGetLabelsAttributeType) (ret CreateImagePayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateImagePayloadGetLabelsAttributeType(arg *CreateImagePayloadGetLabelsAttributeType, val CreateImagePayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for minDiskSize +*/ + +// isLong +type CreateImagePayloadGetMinDiskSizeAttributeType = *int64 +type CreateImagePayloadGetMinDiskSizeArgType = int64 +type CreateImagePayloadGetMinDiskSizeRetType = int64 + +func getCreateImagePayloadGetMinDiskSizeAttributeTypeOk(arg CreateImagePayloadGetMinDiskSizeAttributeType) (ret CreateImagePayloadGetMinDiskSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateImagePayloadGetMinDiskSizeAttributeType(arg *CreateImagePayloadGetMinDiskSizeAttributeType, val CreateImagePayloadGetMinDiskSizeRetType) { + *arg = &val +} + +/* + types and functions for minRam +*/ + +// isLong +type CreateImagePayloadGetMinRamAttributeType = *int64 +type CreateImagePayloadGetMinRamArgType = int64 +type CreateImagePayloadGetMinRamRetType = int64 + +func getCreateImagePayloadGetMinRamAttributeTypeOk(arg CreateImagePayloadGetMinRamAttributeType) (ret CreateImagePayloadGetMinRamRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateImagePayloadGetMinRamAttributeType(arg *CreateImagePayloadGetMinRamAttributeType, val CreateImagePayloadGetMinRamRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateImagePayloadGetNameAttributeType = *string + +func getCreateImagePayloadGetNameAttributeTypeOk(arg CreateImagePayloadGetNameAttributeType) (ret CreateImagePayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateImagePayloadGetNameAttributeType(arg *CreateImagePayloadGetNameAttributeType, val CreateImagePayloadGetNameRetType) { + *arg = &val +} + +type CreateImagePayloadGetNameArgType = string +type CreateImagePayloadGetNameRetType = string + +/* + types and functions for owner +*/ + +// isNotNullableString +type CreateImagePayloadGetOwnerAttributeType = *string + +func getCreateImagePayloadGetOwnerAttributeTypeOk(arg CreateImagePayloadGetOwnerAttributeType) (ret CreateImagePayloadGetOwnerRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateImagePayloadGetOwnerAttributeType(arg *CreateImagePayloadGetOwnerAttributeType, val CreateImagePayloadGetOwnerRetType) { + *arg = &val +} + +type CreateImagePayloadGetOwnerArgType = string +type CreateImagePayloadGetOwnerRetType = string + +/* + types and functions for protected +*/ + +// isBoolean +type CreateImagePayloadgetProtectedAttributeType = *bool +type CreateImagePayloadgetProtectedArgType = bool +type CreateImagePayloadgetProtectedRetType = bool + +func getCreateImagePayloadgetProtectedAttributeTypeOk(arg CreateImagePayloadgetProtectedAttributeType) (ret CreateImagePayloadgetProtectedRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateImagePayloadgetProtectedAttributeType(arg *CreateImagePayloadgetProtectedAttributeType, val CreateImagePayloadgetProtectedRetType) { + *arg = &val +} + +/* + types and functions for scope +*/ + +// isNotNullableString +type CreateImagePayloadGetScopeAttributeType = *string + +func getCreateImagePayloadGetScopeAttributeTypeOk(arg CreateImagePayloadGetScopeAttributeType) (ret CreateImagePayloadGetScopeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateImagePayloadGetScopeAttributeType(arg *CreateImagePayloadGetScopeAttributeType, val CreateImagePayloadGetScopeRetType) { + *arg = &val +} + +type CreateImagePayloadGetScopeArgType = string +type CreateImagePayloadGetScopeRetType = string + +/* + types and functions for size +*/ + +// isLong +type CreateImagePayloadGetSizeAttributeType = *int64 +type CreateImagePayloadGetSizeArgType = int64 +type CreateImagePayloadGetSizeRetType = int64 + +func getCreateImagePayloadGetSizeAttributeTypeOk(arg CreateImagePayloadGetSizeAttributeType) (ret CreateImagePayloadGetSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateImagePayloadGetSizeAttributeType(arg *CreateImagePayloadGetSizeAttributeType, val CreateImagePayloadGetSizeRetType) { + *arg = &val +} + +/* + types and functions for status +*/ + +// isNotNullableString +type CreateImagePayloadGetStatusAttributeType = *string + +func getCreateImagePayloadGetStatusAttributeTypeOk(arg CreateImagePayloadGetStatusAttributeType) (ret CreateImagePayloadGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateImagePayloadGetStatusAttributeType(arg *CreateImagePayloadGetStatusAttributeType, val CreateImagePayloadGetStatusRetType) { + *arg = &val +} + +type CreateImagePayloadGetStatusArgType = string +type CreateImagePayloadGetStatusRetType = string + +/* + types and functions for updatedAt +*/ + +// isDateTime +type CreateImagePayloadGetUpdatedAtAttributeType = *time.Time +type CreateImagePayloadGetUpdatedAtArgType = time.Time +type CreateImagePayloadGetUpdatedAtRetType = time.Time + +func getCreateImagePayloadGetUpdatedAtAttributeTypeOk(arg CreateImagePayloadGetUpdatedAtAttributeType) (ret CreateImagePayloadGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateImagePayloadGetUpdatedAtAttributeType(arg *CreateImagePayloadGetUpdatedAtAttributeType, val CreateImagePayloadGetUpdatedAtRetType) { + *arg = &val +} + // CreateImagePayload Object that represents an Image and its parameters. Used for Creating and returning (get/list). type CreateImagePayload struct { - Checksum *ImageChecksum `json:"checksum,omitempty"` - Config *ImageConfig `json:"config,omitempty"` + Checksum CreateImagePayloadGetChecksumAttributeType `json:"checksum,omitempty"` + Config CreateImagePayloadGetConfigAttributeType `json:"config,omitempty"` // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt CreateImagePayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`. // REQUIRED - DiskFormat *string `json:"diskFormat"` + DiskFormat CreateImagePayloadGetDiskFormatAttributeType `json:"diskFormat"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id CreateImagePayloadGetIdAttributeType `json:"id,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels CreateImagePayloadGetLabelsAttributeType `json:"labels,omitempty"` // Size in Gigabyte. - MinDiskSize *int64 `json:"minDiskSize,omitempty"` + MinDiskSize CreateImagePayloadGetMinDiskSizeAttributeType `json:"minDiskSize,omitempty"` // Size in Megabyte. - MinRam *int64 `json:"minRam,omitempty"` + MinRam CreateImagePayloadGetMinRamAttributeType `json:"minRam,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED - Name *string `json:"name"` + Name CreateImagePayloadGetNameAttributeType `json:"name"` // Universally Unique Identifier (UUID). - Owner *string `json:"owner,omitempty"` - Protected *bool `json:"protected,omitempty"` + Owner CreateImagePayloadGetOwnerAttributeType `json:"owner,omitempty"` + Protected CreateImagePayloadgetProtectedAttributeType `json:"protected,omitempty"` // Scope of an Image. Possible values: `public`, `local`, `projects`, `organization`. - Scope *string `json:"scope,omitempty"` + Scope CreateImagePayloadGetScopeAttributeType `json:"scope,omitempty"` // Size in bytes. - Size *int64 `json:"size,omitempty"` + Size CreateImagePayloadGetSizeAttributeType `json:"size,omitempty"` // The status of an image object. Possible values: `AVAILABLE`, `CREATING`, `DEACTIVATED`, `DELETED`, `DELETING`, `ERROR`. - Status *string `json:"status,omitempty"` + Status CreateImagePayloadGetStatusAttributeType `json:"status,omitempty"` // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAt CreateImagePayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } type _CreateImagePayload CreateImagePayload @@ -57,10 +363,10 @@ type _CreateImagePayload CreateImagePayload // 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 NewCreateImagePayload(diskFormat *string, name *string) *CreateImagePayload { +func NewCreateImagePayload(diskFormat CreateImagePayloadGetDiskFormatArgType, name CreateImagePayloadGetNameArgType) *CreateImagePayload { this := CreateImagePayload{} - this.DiskFormat = diskFormat - this.Name = name + setCreateImagePayloadGetDiskFormatAttributeType(&this.DiskFormat, diskFormat) + setCreateImagePayloadGetNameAttributeType(&this.Name, name) return &this } @@ -73,511 +379,384 @@ func NewCreateImagePayloadWithDefaults() *CreateImagePayload { } // GetChecksum returns the Checksum field value if set, zero value otherwise. -func (o *CreateImagePayload) GetChecksum() *ImageChecksum { - if o == nil || IsNil(o.Checksum) { - var ret *ImageChecksum - return ret - } - return o.Checksum +func (o *CreateImagePayload) GetChecksum() (res CreateImagePayloadGetChecksumRetType) { + res, _ = o.GetChecksumOk() + return } // GetChecksumOk returns a tuple with the Checksum field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateImagePayload) GetChecksumOk() (*ImageChecksum, bool) { - if o == nil || IsNil(o.Checksum) { - return nil, false - } - return o.Checksum, true +func (o *CreateImagePayload) GetChecksumOk() (ret CreateImagePayloadGetChecksumRetType, ok bool) { + return getCreateImagePayloadGetChecksumAttributeTypeOk(o.Checksum) } // HasChecksum returns a boolean if a field has been set. func (o *CreateImagePayload) HasChecksum() bool { - if o != nil && !IsNil(o.Checksum) { - return true - } - - return false + _, ok := o.GetChecksumOk() + return ok } // SetChecksum gets a reference to the given ImageChecksum and assigns it to the Checksum field. -func (o *CreateImagePayload) SetChecksum(v *ImageChecksum) { - o.Checksum = v +func (o *CreateImagePayload) SetChecksum(v CreateImagePayloadGetChecksumRetType) { + setCreateImagePayloadGetChecksumAttributeType(&o.Checksum, v) } // GetConfig returns the Config field value if set, zero value otherwise. -func (o *CreateImagePayload) GetConfig() *ImageConfig { - if o == nil || IsNil(o.Config) { - var ret *ImageConfig - return ret - } - return o.Config +func (o *CreateImagePayload) GetConfig() (res CreateImagePayloadGetConfigRetType) { + res, _ = o.GetConfigOk() + return } // GetConfigOk returns a tuple with the Config field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateImagePayload) GetConfigOk() (*ImageConfig, bool) { - if o == nil || IsNil(o.Config) { - return nil, false - } - return o.Config, true +func (o *CreateImagePayload) GetConfigOk() (ret CreateImagePayloadGetConfigRetType, ok bool) { + return getCreateImagePayloadGetConfigAttributeTypeOk(o.Config) } // HasConfig returns a boolean if a field has been set. func (o *CreateImagePayload) HasConfig() bool { - if o != nil && !IsNil(o.Config) { - return true - } - - return false + _, ok := o.GetConfigOk() + return ok } // SetConfig gets a reference to the given ImageConfig and assigns it to the Config field. -func (o *CreateImagePayload) SetConfig(v *ImageConfig) { - o.Config = v +func (o *CreateImagePayload) SetConfig(v CreateImagePayloadGetConfigRetType) { + setCreateImagePayloadGetConfigAttributeType(&o.Config, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *CreateImagePayload) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - return o.CreatedAt +func (o *CreateImagePayload) GetCreatedAt() (res CreateImagePayloadGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return } // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateImagePayload) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true +func (o *CreateImagePayload) GetCreatedAtOk() (ret CreateImagePayloadGetCreatedAtRetType, ok bool) { + return getCreateImagePayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. func (o *CreateImagePayload) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false + _, ok := o.GetCreatedAtOk() + return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *CreateImagePayload) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *CreateImagePayload) SetCreatedAt(v CreateImagePayloadGetCreatedAtRetType) { + setCreateImagePayloadGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDiskFormat returns the DiskFormat field value -func (o *CreateImagePayload) GetDiskFormat() *string { - if o == nil || IsNil(o.DiskFormat) { - var ret *string - return ret - } - - return o.DiskFormat +func (o *CreateImagePayload) GetDiskFormat() (ret CreateImagePayloadGetDiskFormatRetType) { + ret, _ = o.GetDiskFormatOk() + return ret } // GetDiskFormatOk returns a tuple with the DiskFormat field value // and a boolean to check if the value has been set. -func (o *CreateImagePayload) GetDiskFormatOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.DiskFormat, true +func (o *CreateImagePayload) GetDiskFormatOk() (ret CreateImagePayloadGetDiskFormatRetType, ok bool) { + return getCreateImagePayloadGetDiskFormatAttributeTypeOk(o.DiskFormat) } // SetDiskFormat sets field value -func (o *CreateImagePayload) SetDiskFormat(v *string) { - o.DiskFormat = v +func (o *CreateImagePayload) SetDiskFormat(v CreateImagePayloadGetDiskFormatRetType) { + setCreateImagePayloadGetDiskFormatAttributeType(&o.DiskFormat, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *CreateImagePayload) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *CreateImagePayload) GetId() (res CreateImagePayloadGetIdRetType) { + 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 *CreateImagePayload) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *CreateImagePayload) GetIdOk() (ret CreateImagePayloadGetIdRetType, ok bool) { + return getCreateImagePayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *CreateImagePayload) 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 *CreateImagePayload) SetId(v *string) { - o.Id = v +func (o *CreateImagePayload) SetId(v CreateImagePayloadGetIdRetType) { + setCreateImagePayloadGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateImagePayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *CreateImagePayload) GetLabels() (res CreateImagePayloadGetLabelsRetType) { + 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 *CreateImagePayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *CreateImagePayload) GetLabelsOk() (ret CreateImagePayloadGetLabelsRetType, ok bool) { + return getCreateImagePayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *CreateImagePayload) 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 *CreateImagePayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *CreateImagePayload) SetLabels(v CreateImagePayloadGetLabelsRetType) { + setCreateImagePayloadGetLabelsAttributeType(&o.Labels, v) } // GetMinDiskSize returns the MinDiskSize field value if set, zero value otherwise. -func (o *CreateImagePayload) GetMinDiskSize() *int64 { - if o == nil || IsNil(o.MinDiskSize) { - var ret *int64 - return ret - } - return o.MinDiskSize +func (o *CreateImagePayload) GetMinDiskSize() (res CreateImagePayloadGetMinDiskSizeRetType) { + res, _ = o.GetMinDiskSizeOk() + return } // GetMinDiskSizeOk returns a tuple with the MinDiskSize field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateImagePayload) GetMinDiskSizeOk() (*int64, bool) { - if o == nil || IsNil(o.MinDiskSize) { - return nil, false - } - return o.MinDiskSize, true +func (o *CreateImagePayload) GetMinDiskSizeOk() (ret CreateImagePayloadGetMinDiskSizeRetType, ok bool) { + return getCreateImagePayloadGetMinDiskSizeAttributeTypeOk(o.MinDiskSize) } // HasMinDiskSize returns a boolean if a field has been set. func (o *CreateImagePayload) HasMinDiskSize() bool { - if o != nil && !IsNil(o.MinDiskSize) { - return true - } - - return false + _, ok := o.GetMinDiskSizeOk() + return ok } // SetMinDiskSize gets a reference to the given int64 and assigns it to the MinDiskSize field. -func (o *CreateImagePayload) SetMinDiskSize(v *int64) { - o.MinDiskSize = v +func (o *CreateImagePayload) SetMinDiskSize(v CreateImagePayloadGetMinDiskSizeRetType) { + setCreateImagePayloadGetMinDiskSizeAttributeType(&o.MinDiskSize, v) } // GetMinRam returns the MinRam field value if set, zero value otherwise. -func (o *CreateImagePayload) GetMinRam() *int64 { - if o == nil || IsNil(o.MinRam) { - var ret *int64 - return ret - } - return o.MinRam +func (o *CreateImagePayload) GetMinRam() (res CreateImagePayloadGetMinRamRetType) { + res, _ = o.GetMinRamOk() + return } // GetMinRamOk returns a tuple with the MinRam field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateImagePayload) GetMinRamOk() (*int64, bool) { - if o == nil || IsNil(o.MinRam) { - return nil, false - } - return o.MinRam, true +func (o *CreateImagePayload) GetMinRamOk() (ret CreateImagePayloadGetMinRamRetType, ok bool) { + return getCreateImagePayloadGetMinRamAttributeTypeOk(o.MinRam) } // HasMinRam returns a boolean if a field has been set. func (o *CreateImagePayload) HasMinRam() bool { - if o != nil && !IsNil(o.MinRam) { - return true - } - - return false + _, ok := o.GetMinRamOk() + return ok } // SetMinRam gets a reference to the given int64 and assigns it to the MinRam field. -func (o *CreateImagePayload) SetMinRam(v *int64) { - o.MinRam = v +func (o *CreateImagePayload) SetMinRam(v CreateImagePayloadGetMinRamRetType) { + setCreateImagePayloadGetMinRamAttributeType(&o.MinRam, v) } // GetName returns the Name field value -func (o *CreateImagePayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *CreateImagePayload) GetName() (ret CreateImagePayloadGetNameRetType) { + 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 *CreateImagePayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *CreateImagePayload) GetNameOk() (ret CreateImagePayloadGetNameRetType, ok bool) { + return getCreateImagePayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *CreateImagePayload) SetName(v *string) { - o.Name = v +func (o *CreateImagePayload) SetName(v CreateImagePayloadGetNameRetType) { + setCreateImagePayloadGetNameAttributeType(&o.Name, v) } // GetOwner returns the Owner field value if set, zero value otherwise. -func (o *CreateImagePayload) GetOwner() *string { - if o == nil || IsNil(o.Owner) { - var ret *string - return ret - } - return o.Owner +func (o *CreateImagePayload) GetOwner() (res CreateImagePayloadGetOwnerRetType) { + 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 *CreateImagePayload) GetOwnerOk() (*string, bool) { - if o == nil || IsNil(o.Owner) { - return nil, false - } - return o.Owner, true +func (o *CreateImagePayload) GetOwnerOk() (ret CreateImagePayloadGetOwnerRetType, ok bool) { + return getCreateImagePayloadGetOwnerAttributeTypeOk(o.Owner) } // HasOwner returns a boolean if a field has been set. func (o *CreateImagePayload) 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 *CreateImagePayload) SetOwner(v *string) { - o.Owner = v +func (o *CreateImagePayload) SetOwner(v CreateImagePayloadGetOwnerRetType) { + setCreateImagePayloadGetOwnerAttributeType(&o.Owner, v) } // GetProtected returns the Protected field value if set, zero value otherwise. -func (o *CreateImagePayload) GetProtected() *bool { - if o == nil || IsNil(o.Protected) { - var ret *bool - return ret - } - return o.Protected +func (o *CreateImagePayload) GetProtected() (res CreateImagePayloadgetProtectedRetType) { + res, _ = o.GetProtectedOk() + return } // GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateImagePayload) GetProtectedOk() (*bool, bool) { - if o == nil || IsNil(o.Protected) { - return nil, false - } - return o.Protected, true +func (o *CreateImagePayload) GetProtectedOk() (ret CreateImagePayloadgetProtectedRetType, ok bool) { + return getCreateImagePayloadgetProtectedAttributeTypeOk(o.Protected) } // HasProtected returns a boolean if a field has been set. func (o *CreateImagePayload) HasProtected() bool { - if o != nil && !IsNil(o.Protected) { - return true - } - - return false + _, ok := o.GetProtectedOk() + return ok } // SetProtected gets a reference to the given bool and assigns it to the Protected field. -func (o *CreateImagePayload) SetProtected(v *bool) { - o.Protected = v +func (o *CreateImagePayload) SetProtected(v CreateImagePayloadgetProtectedRetType) { + setCreateImagePayloadgetProtectedAttributeType(&o.Protected, v) } // GetScope returns the Scope field value if set, zero value otherwise. -func (o *CreateImagePayload) GetScope() *string { - if o == nil || IsNil(o.Scope) { - var ret *string - return ret - } - return o.Scope +func (o *CreateImagePayload) GetScope() (res CreateImagePayloadGetScopeRetType) { + res, _ = o.GetScopeOk() + return } // GetScopeOk returns a tuple with the Scope field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateImagePayload) GetScopeOk() (*string, bool) { - if o == nil || IsNil(o.Scope) { - return nil, false - } - return o.Scope, true +func (o *CreateImagePayload) GetScopeOk() (ret CreateImagePayloadGetScopeRetType, ok bool) { + return getCreateImagePayloadGetScopeAttributeTypeOk(o.Scope) } // HasScope returns a boolean if a field has been set. func (o *CreateImagePayload) HasScope() bool { - if o != nil && !IsNil(o.Scope) { - return true - } - - return false + _, ok := o.GetScopeOk() + return ok } // SetScope gets a reference to the given string and assigns it to the Scope field. -func (o *CreateImagePayload) SetScope(v *string) { - o.Scope = v +func (o *CreateImagePayload) SetScope(v CreateImagePayloadGetScopeRetType) { + setCreateImagePayloadGetScopeAttributeType(&o.Scope, v) } // GetSize returns the Size field value if set, zero value otherwise. -func (o *CreateImagePayload) GetSize() *int64 { - if o == nil || IsNil(o.Size) { - var ret *int64 - return ret - } - return o.Size +func (o *CreateImagePayload) GetSize() (res CreateImagePayloadGetSizeRetType) { + 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 *CreateImagePayload) GetSizeOk() (*int64, bool) { - if o == nil || IsNil(o.Size) { - return nil, false - } - return o.Size, true +func (o *CreateImagePayload) GetSizeOk() (ret CreateImagePayloadGetSizeRetType, ok bool) { + return getCreateImagePayloadGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. func (o *CreateImagePayload) 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 *CreateImagePayload) SetSize(v *int64) { - o.Size = v +func (o *CreateImagePayload) SetSize(v CreateImagePayloadGetSizeRetType) { + setCreateImagePayloadGetSizeAttributeType(&o.Size, v) } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *CreateImagePayload) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - return o.Status +func (o *CreateImagePayload) GetStatus() (res CreateImagePayloadGetStatusRetType) { + 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 *CreateImagePayload) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true +func (o *CreateImagePayload) GetStatusOk() (ret CreateImagePayloadGetStatusRetType, ok bool) { + return getCreateImagePayloadGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. func (o *CreateImagePayload) 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 *CreateImagePayload) SetStatus(v *string) { - o.Status = v +func (o *CreateImagePayload) SetStatus(v CreateImagePayloadGetStatusRetType) { + setCreateImagePayloadGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *CreateImagePayload) GetUpdatedAt() *time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret *time.Time - return ret - } - return o.UpdatedAt +func (o *CreateImagePayload) GetUpdatedAt() (res CreateImagePayloadGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateImagePayload) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true +func (o *CreateImagePayload) GetUpdatedAtOk() (ret CreateImagePayloadGetUpdatedAtRetType, ok bool) { + return getCreateImagePayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. func (o *CreateImagePayload) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false + _, ok := o.GetUpdatedAtOk() + return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *CreateImagePayload) SetUpdatedAt(v *time.Time) { - o.UpdatedAt = v +func (o *CreateImagePayload) SetUpdatedAt(v CreateImagePayloadGetUpdatedAtRetType) { + setCreateImagePayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) } func (o CreateImagePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Checksum) { - toSerialize["checksum"] = o.Checksum + if val, ok := getCreateImagePayloadGetChecksumAttributeTypeOk(o.Checksum); ok { + toSerialize["Checksum"] = val + } + if val, ok := getCreateImagePayloadGetConfigAttributeTypeOk(o.Config); ok { + toSerialize["Config"] = val + } + if val, ok := getCreateImagePayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val } - if !IsNil(o.Config) { - toSerialize["config"] = o.Config + if val, ok := getCreateImagePayloadGetDiskFormatAttributeTypeOk(o.DiskFormat); ok { + toSerialize["DiskFormat"] = val } - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt + if val, ok := getCreateImagePayloadGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - toSerialize["diskFormat"] = o.DiskFormat - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getCreateImagePayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getCreateImagePayloadGetMinDiskSizeAttributeTypeOk(o.MinDiskSize); ok { + toSerialize["MinDiskSize"] = val } - if !IsNil(o.MinDiskSize) { - toSerialize["minDiskSize"] = o.MinDiskSize + if val, ok := getCreateImagePayloadGetMinRamAttributeTypeOk(o.MinRam); ok { + toSerialize["MinRam"] = val } - if !IsNil(o.MinRam) { - toSerialize["minRam"] = o.MinRam + if val, ok := getCreateImagePayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - toSerialize["name"] = o.Name - if !IsNil(o.Owner) { - toSerialize["owner"] = o.Owner + if val, ok := getCreateImagePayloadGetOwnerAttributeTypeOk(o.Owner); ok { + toSerialize["Owner"] = val } - if !IsNil(o.Protected) { - toSerialize["protected"] = o.Protected + if val, ok := getCreateImagePayloadgetProtectedAttributeTypeOk(o.Protected); ok { + toSerialize["Protected"] = val } - if !IsNil(o.Scope) { - toSerialize["scope"] = o.Scope + if val, ok := getCreateImagePayloadGetScopeAttributeTypeOk(o.Scope); ok { + toSerialize["Scope"] = val } - if !IsNil(o.Size) { - toSerialize["size"] = o.Size + if val, ok := getCreateImagePayloadGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status + if val, ok := getCreateImagePayloadGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt + if val, ok := getCreateImagePayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_key_pair_payload.go b/services/iaas/model_create_key_pair_payload.go index 48c27576f..a151d3124 100644 --- a/services/iaas/model_create_key_pair_payload.go +++ b/services/iaas/model_create_key_pair_payload.go @@ -18,21 +18,144 @@ import ( // checks if the CreateKeyPairPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateKeyPairPayload{} +/* + types and functions for createdAt +*/ + +// isDateTime +type CreateKeyPairPayloadGetCreatedAtAttributeType = *time.Time +type CreateKeyPairPayloadGetCreatedAtArgType = time.Time +type CreateKeyPairPayloadGetCreatedAtRetType = time.Time + +func getCreateKeyPairPayloadGetCreatedAtAttributeTypeOk(arg CreateKeyPairPayloadGetCreatedAtAttributeType) (ret CreateKeyPairPayloadGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateKeyPairPayloadGetCreatedAtAttributeType(arg *CreateKeyPairPayloadGetCreatedAtAttributeType, val CreateKeyPairPayloadGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for fingerprint +*/ + +// isNotNullableString +type CreateKeyPairPayloadGetFingerprintAttributeType = *string + +func getCreateKeyPairPayloadGetFingerprintAttributeTypeOk(arg CreateKeyPairPayloadGetFingerprintAttributeType) (ret CreateKeyPairPayloadGetFingerprintRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateKeyPairPayloadGetFingerprintAttributeType(arg *CreateKeyPairPayloadGetFingerprintAttributeType, val CreateKeyPairPayloadGetFingerprintRetType) { + *arg = &val +} + +type CreateKeyPairPayloadGetFingerprintArgType = string +type CreateKeyPairPayloadGetFingerprintRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type CreateKeyPairPayloadGetLabelsAttributeType = *map[string]interface{} +type CreateKeyPairPayloadGetLabelsArgType = map[string]interface{} +type CreateKeyPairPayloadGetLabelsRetType = map[string]interface{} + +func getCreateKeyPairPayloadGetLabelsAttributeTypeOk(arg CreateKeyPairPayloadGetLabelsAttributeType) (ret CreateKeyPairPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateKeyPairPayloadGetLabelsAttributeType(arg *CreateKeyPairPayloadGetLabelsAttributeType, val CreateKeyPairPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateKeyPairPayloadGetNameAttributeType = *string + +func getCreateKeyPairPayloadGetNameAttributeTypeOk(arg CreateKeyPairPayloadGetNameAttributeType) (ret CreateKeyPairPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateKeyPairPayloadGetNameAttributeType(arg *CreateKeyPairPayloadGetNameAttributeType, val CreateKeyPairPayloadGetNameRetType) { + *arg = &val +} + +type CreateKeyPairPayloadGetNameArgType = string +type CreateKeyPairPayloadGetNameRetType = string + +/* + types and functions for publicKey +*/ + +// isNotNullableString +type CreateKeyPairPayloadGetPublicKeyAttributeType = *string + +func getCreateKeyPairPayloadGetPublicKeyAttributeTypeOk(arg CreateKeyPairPayloadGetPublicKeyAttributeType) (ret CreateKeyPairPayloadGetPublicKeyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateKeyPairPayloadGetPublicKeyAttributeType(arg *CreateKeyPairPayloadGetPublicKeyAttributeType, val CreateKeyPairPayloadGetPublicKeyRetType) { + *arg = &val +} + +type CreateKeyPairPayloadGetPublicKeyArgType = string +type CreateKeyPairPayloadGetPublicKeyRetType = string + +/* + types and functions for updatedAt +*/ + +// isDateTime +type CreateKeyPairPayloadGetUpdatedAtAttributeType = *time.Time +type CreateKeyPairPayloadGetUpdatedAtArgType = time.Time +type CreateKeyPairPayloadGetUpdatedAtRetType = time.Time + +func getCreateKeyPairPayloadGetUpdatedAtAttributeTypeOk(arg CreateKeyPairPayloadGetUpdatedAtAttributeType) (ret CreateKeyPairPayloadGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateKeyPairPayloadGetUpdatedAtAttributeType(arg *CreateKeyPairPayloadGetUpdatedAtAttributeType, val CreateKeyPairPayloadGetUpdatedAtRetType) { + *arg = &val +} + // CreateKeyPairPayload Object that represents the public key of an SSH keypair and its name. type CreateKeyPairPayload struct { // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt CreateKeyPairPayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Object that represents an SSH keypair MD5 fingerprint. - Fingerprint *string `json:"fingerprint,omitempty"` + Fingerprint CreateKeyPairPayloadGetFingerprintAttributeType `json:"fingerprint,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels CreateKeyPairPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. - Name *string `json:"name,omitempty"` + Name CreateKeyPairPayloadGetNameAttributeType `json:"name,omitempty"` // Object that represents a public SSH key. // REQUIRED - PublicKey *string `json:"publicKey"` + PublicKey CreateKeyPairPayloadGetPublicKeyAttributeType `json:"publicKey"` // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAt CreateKeyPairPayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } type _CreateKeyPairPayload CreateKeyPairPayload @@ -41,9 +164,9 @@ type _CreateKeyPairPayload CreateKeyPairPayload // 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 NewCreateKeyPairPayload(publicKey *string) *CreateKeyPairPayload { +func NewCreateKeyPairPayload(publicKey CreateKeyPairPayloadGetPublicKeyArgType) *CreateKeyPairPayload { this := CreateKeyPairPayload{} - this.PublicKey = publicKey + setCreateKeyPairPayloadGetPublicKeyAttributeType(&this.PublicKey, publicKey) return &this } @@ -56,206 +179,156 @@ func NewCreateKeyPairPayloadWithDefaults() *CreateKeyPairPayload { } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *CreateKeyPairPayload) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - return o.CreatedAt +func (o *CreateKeyPairPayload) GetCreatedAt() (res CreateKeyPairPayloadGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return } // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateKeyPairPayload) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true +func (o *CreateKeyPairPayload) GetCreatedAtOk() (ret CreateKeyPairPayloadGetCreatedAtRetType, ok bool) { + return getCreateKeyPairPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. func (o *CreateKeyPairPayload) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false + _, ok := o.GetCreatedAtOk() + return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *CreateKeyPairPayload) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *CreateKeyPairPayload) SetCreatedAt(v CreateKeyPairPayloadGetCreatedAtRetType) { + setCreateKeyPairPayloadGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetFingerprint returns the Fingerprint field value if set, zero value otherwise. -func (o *CreateKeyPairPayload) GetFingerprint() *string { - if o == nil || IsNil(o.Fingerprint) { - var ret *string - return ret - } - return o.Fingerprint +func (o *CreateKeyPairPayload) GetFingerprint() (res CreateKeyPairPayloadGetFingerprintRetType) { + res, _ = o.GetFingerprintOk() + return } // GetFingerprintOk returns a tuple with the Fingerprint field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateKeyPairPayload) GetFingerprintOk() (*string, bool) { - if o == nil || IsNil(o.Fingerprint) { - return nil, false - } - return o.Fingerprint, true +func (o *CreateKeyPairPayload) GetFingerprintOk() (ret CreateKeyPairPayloadGetFingerprintRetType, ok bool) { + return getCreateKeyPairPayloadGetFingerprintAttributeTypeOk(o.Fingerprint) } // HasFingerprint returns a boolean if a field has been set. func (o *CreateKeyPairPayload) HasFingerprint() bool { - if o != nil && !IsNil(o.Fingerprint) { - return true - } - - return false + _, ok := o.GetFingerprintOk() + return ok } // SetFingerprint gets a reference to the given string and assigns it to the Fingerprint field. -func (o *CreateKeyPairPayload) SetFingerprint(v *string) { - o.Fingerprint = v +func (o *CreateKeyPairPayload) SetFingerprint(v CreateKeyPairPayloadGetFingerprintRetType) { + setCreateKeyPairPayloadGetFingerprintAttributeType(&o.Fingerprint, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateKeyPairPayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *CreateKeyPairPayload) GetLabels() (res CreateKeyPairPayloadGetLabelsRetType) { + 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 *CreateKeyPairPayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *CreateKeyPairPayload) GetLabelsOk() (ret CreateKeyPairPayloadGetLabelsRetType, ok bool) { + return getCreateKeyPairPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *CreateKeyPairPayload) 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 *CreateKeyPairPayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *CreateKeyPairPayload) SetLabels(v CreateKeyPairPayloadGetLabelsRetType) { + setCreateKeyPairPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *CreateKeyPairPayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *CreateKeyPairPayload) GetName() (res CreateKeyPairPayloadGetNameRetType) { + 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 *CreateKeyPairPayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *CreateKeyPairPayload) GetNameOk() (ret CreateKeyPairPayloadGetNameRetType, ok bool) { + return getCreateKeyPairPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *CreateKeyPairPayload) 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 *CreateKeyPairPayload) SetName(v *string) { - o.Name = v +func (o *CreateKeyPairPayload) SetName(v CreateKeyPairPayloadGetNameRetType) { + setCreateKeyPairPayloadGetNameAttributeType(&o.Name, v) } // GetPublicKey returns the PublicKey field value -func (o *CreateKeyPairPayload) GetPublicKey() *string { - if o == nil || IsNil(o.PublicKey) { - var ret *string - return ret - } - - return o.PublicKey +func (o *CreateKeyPairPayload) GetPublicKey() (ret CreateKeyPairPayloadGetPublicKeyRetType) { + ret, _ = o.GetPublicKeyOk() + return ret } // GetPublicKeyOk returns a tuple with the PublicKey field value // and a boolean to check if the value has been set. -func (o *CreateKeyPairPayload) GetPublicKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.PublicKey, true +func (o *CreateKeyPairPayload) GetPublicKeyOk() (ret CreateKeyPairPayloadGetPublicKeyRetType, ok bool) { + return getCreateKeyPairPayloadGetPublicKeyAttributeTypeOk(o.PublicKey) } // SetPublicKey sets field value -func (o *CreateKeyPairPayload) SetPublicKey(v *string) { - o.PublicKey = v +func (o *CreateKeyPairPayload) SetPublicKey(v CreateKeyPairPayloadGetPublicKeyRetType) { + setCreateKeyPairPayloadGetPublicKeyAttributeType(&o.PublicKey, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *CreateKeyPairPayload) GetUpdatedAt() *time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret *time.Time - return ret - } - return o.UpdatedAt +func (o *CreateKeyPairPayload) GetUpdatedAt() (res CreateKeyPairPayloadGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateKeyPairPayload) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true +func (o *CreateKeyPairPayload) GetUpdatedAtOk() (ret CreateKeyPairPayloadGetUpdatedAtRetType, ok bool) { + return getCreateKeyPairPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. func (o *CreateKeyPairPayload) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false + _, ok := o.GetUpdatedAtOk() + return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *CreateKeyPairPayload) SetUpdatedAt(v *time.Time) { - o.UpdatedAt = v +func (o *CreateKeyPairPayload) SetUpdatedAt(v CreateKeyPairPayloadGetUpdatedAtRetType) { + setCreateKeyPairPayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) } func (o CreateKeyPairPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt + if val, ok := getCreateKeyPairPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getCreateKeyPairPayloadGetFingerprintAttributeTypeOk(o.Fingerprint); ok { + toSerialize["Fingerprint"] = val } - if !IsNil(o.Fingerprint) { - toSerialize["fingerprint"] = o.Fingerprint + if val, ok := getCreateKeyPairPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getCreateKeyPairPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getCreateKeyPairPayloadGetPublicKeyAttributeTypeOk(o.PublicKey); ok { + toSerialize["PublicKey"] = val } - toSerialize["publicKey"] = o.PublicKey - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt + if val, ok := getCreateKeyPairPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_network_address_family.go b/services/iaas/model_create_network_address_family.go index e142511df..4d16f5e85 100644 --- a/services/iaas/model_create_network_address_family.go +++ b/services/iaas/model_create_network_address_family.go @@ -17,10 +17,50 @@ import ( // checks if the CreateNetworkAddressFamily type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateNetworkAddressFamily{} +/* + types and functions for ipv4 +*/ + +// isModel +type CreateNetworkAddressFamilyGetIpv4AttributeType = *CreateNetworkIPv4Body +type CreateNetworkAddressFamilyGetIpv4ArgType = CreateNetworkIPv4Body +type CreateNetworkAddressFamilyGetIpv4RetType = CreateNetworkIPv4Body + +func getCreateNetworkAddressFamilyGetIpv4AttributeTypeOk(arg CreateNetworkAddressFamilyGetIpv4AttributeType) (ret CreateNetworkAddressFamilyGetIpv4RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkAddressFamilyGetIpv4AttributeType(arg *CreateNetworkAddressFamilyGetIpv4AttributeType, val CreateNetworkAddressFamilyGetIpv4RetType) { + *arg = &val +} + +/* + types and functions for ipv6 +*/ + +// isModel +type CreateNetworkAddressFamilyGetIpv6AttributeType = *CreateNetworkIPv6Body +type CreateNetworkAddressFamilyGetIpv6ArgType = CreateNetworkIPv6Body +type CreateNetworkAddressFamilyGetIpv6RetType = CreateNetworkIPv6Body + +func getCreateNetworkAddressFamilyGetIpv6AttributeTypeOk(arg CreateNetworkAddressFamilyGetIpv6AttributeType) (ret CreateNetworkAddressFamilyGetIpv6RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkAddressFamilyGetIpv6AttributeType(arg *CreateNetworkAddressFamilyGetIpv6AttributeType, val CreateNetworkAddressFamilyGetIpv6RetType) { + *arg = &val +} + // CreateNetworkAddressFamily The addressFamily object for a network create request. type CreateNetworkAddressFamily struct { - Ipv4 *CreateNetworkIPv4Body `json:"ipv4,omitempty"` - Ipv6 *CreateNetworkIPv6Body `json:"ipv6,omitempty"` + Ipv4 CreateNetworkAddressFamilyGetIpv4AttributeType `json:"ipv4,omitempty"` + Ipv6 CreateNetworkAddressFamilyGetIpv6AttributeType `json:"ipv6,omitempty"` } // NewCreateNetworkAddressFamily instantiates a new CreateNetworkAddressFamily object @@ -41,76 +81,58 @@ func NewCreateNetworkAddressFamilyWithDefaults() *CreateNetworkAddressFamily { } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *CreateNetworkAddressFamily) GetIpv4() *CreateNetworkIPv4Body { - if o == nil || IsNil(o.Ipv4) { - var ret *CreateNetworkIPv4Body - return ret - } - return o.Ipv4 +func (o *CreateNetworkAddressFamily) GetIpv4() (res CreateNetworkAddressFamilyGetIpv4RetType) { + res, _ = o.GetIpv4Ok() + return } // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNetworkAddressFamily) GetIpv4Ok() (*CreateNetworkIPv4Body, bool) { - if o == nil || IsNil(o.Ipv4) { - return nil, false - } - return o.Ipv4, true +func (o *CreateNetworkAddressFamily) GetIpv4Ok() (ret CreateNetworkAddressFamilyGetIpv4RetType, ok bool) { + return getCreateNetworkAddressFamilyGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. func (o *CreateNetworkAddressFamily) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { - return true - } - - return false + _, ok := o.GetIpv4Ok() + return ok } // SetIpv4 gets a reference to the given CreateNetworkIPv4Body and assigns it to the Ipv4 field. -func (o *CreateNetworkAddressFamily) SetIpv4(v *CreateNetworkIPv4Body) { - o.Ipv4 = v +func (o *CreateNetworkAddressFamily) SetIpv4(v CreateNetworkAddressFamilyGetIpv4RetType) { + setCreateNetworkAddressFamilyGetIpv4AttributeType(&o.Ipv4, v) } // GetIpv6 returns the Ipv6 field value if set, zero value otherwise. -func (o *CreateNetworkAddressFamily) GetIpv6() *CreateNetworkIPv6Body { - if o == nil || IsNil(o.Ipv6) { - var ret *CreateNetworkIPv6Body - return ret - } - return o.Ipv6 +func (o *CreateNetworkAddressFamily) GetIpv6() (res CreateNetworkAddressFamilyGetIpv6RetType) { + res, _ = o.GetIpv6Ok() + return } // GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNetworkAddressFamily) GetIpv6Ok() (*CreateNetworkIPv6Body, bool) { - if o == nil || IsNil(o.Ipv6) { - return nil, false - } - return o.Ipv6, true +func (o *CreateNetworkAddressFamily) GetIpv6Ok() (ret CreateNetworkAddressFamilyGetIpv6RetType, ok bool) { + return getCreateNetworkAddressFamilyGetIpv6AttributeTypeOk(o.Ipv6) } // HasIpv6 returns a boolean if a field has been set. func (o *CreateNetworkAddressFamily) HasIpv6() bool { - if o != nil && !IsNil(o.Ipv6) { - return true - } - - return false + _, ok := o.GetIpv6Ok() + return ok } // SetIpv6 gets a reference to the given CreateNetworkIPv6Body and assigns it to the Ipv6 field. -func (o *CreateNetworkAddressFamily) SetIpv6(v *CreateNetworkIPv6Body) { - o.Ipv6 = v +func (o *CreateNetworkAddressFamily) SetIpv6(v CreateNetworkAddressFamilyGetIpv6RetType) { + setCreateNetworkAddressFamilyGetIpv6AttributeType(&o.Ipv6, v) } func (o CreateNetworkAddressFamily) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Ipv4) { - toSerialize["ipv4"] = o.Ipv4 + if val, ok := getCreateNetworkAddressFamilyGetIpv4AttributeTypeOk(o.Ipv4); ok { + toSerialize["Ipv4"] = val } - if !IsNil(o.Ipv6) { - toSerialize["ipv6"] = o.Ipv6 + if val, ok := getCreateNetworkAddressFamilyGetIpv6AttributeTypeOk(o.Ipv6); ok { + toSerialize["Ipv6"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_network_area_payload.go b/services/iaas/model_create_network_area_payload.go index bcf2d0cd4..8ae37e597 100644 --- a/services/iaas/model_create_network_area_payload.go +++ b/services/iaas/model_create_network_area_payload.go @@ -17,15 +17,76 @@ import ( // checks if the CreateNetworkAreaPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateNetworkAreaPayload{} +/* + types and functions for addressFamily +*/ + +// isModel +type CreateNetworkAreaPayloadGetAddressFamilyAttributeType = *CreateAreaAddressFamily +type CreateNetworkAreaPayloadGetAddressFamilyArgType = CreateAreaAddressFamily +type CreateNetworkAreaPayloadGetAddressFamilyRetType = CreateAreaAddressFamily + +func getCreateNetworkAreaPayloadGetAddressFamilyAttributeTypeOk(arg CreateNetworkAreaPayloadGetAddressFamilyAttributeType) (ret CreateNetworkAreaPayloadGetAddressFamilyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkAreaPayloadGetAddressFamilyAttributeType(arg *CreateNetworkAreaPayloadGetAddressFamilyAttributeType, val CreateNetworkAreaPayloadGetAddressFamilyRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isFreeform +type CreateNetworkAreaPayloadGetLabelsAttributeType = *map[string]interface{} +type CreateNetworkAreaPayloadGetLabelsArgType = map[string]interface{} +type CreateNetworkAreaPayloadGetLabelsRetType = map[string]interface{} + +func getCreateNetworkAreaPayloadGetLabelsAttributeTypeOk(arg CreateNetworkAreaPayloadGetLabelsAttributeType) (ret CreateNetworkAreaPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkAreaPayloadGetLabelsAttributeType(arg *CreateNetworkAreaPayloadGetLabelsAttributeType, val CreateNetworkAreaPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateNetworkAreaPayloadGetNameAttributeType = *string + +func getCreateNetworkAreaPayloadGetNameAttributeTypeOk(arg CreateNetworkAreaPayloadGetNameAttributeType) (ret CreateNetworkAreaPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkAreaPayloadGetNameAttributeType(arg *CreateNetworkAreaPayloadGetNameAttributeType, val CreateNetworkAreaPayloadGetNameRetType) { + *arg = &val +} + +type CreateNetworkAreaPayloadGetNameArgType = string +type CreateNetworkAreaPayloadGetNameRetType = string + // CreateNetworkAreaPayload struct for CreateNetworkAreaPayload type CreateNetworkAreaPayload struct { // REQUIRED - AddressFamily *CreateAreaAddressFamily `json:"addressFamily"` + AddressFamily CreateNetworkAreaPayloadGetAddressFamilyAttributeType `json:"addressFamily"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels CreateNetworkAreaPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED - Name *string `json:"name"` + Name CreateNetworkAreaPayloadGetNameAttributeType `json:"name"` } type _CreateNetworkAreaPayload CreateNetworkAreaPayload @@ -34,10 +95,10 @@ type _CreateNetworkAreaPayload CreateNetworkAreaPayload // 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 NewCreateNetworkAreaPayload(addressFamily *CreateAreaAddressFamily, name *string) *CreateNetworkAreaPayload { +func NewCreateNetworkAreaPayload(addressFamily CreateNetworkAreaPayloadGetAddressFamilyArgType, name CreateNetworkAreaPayloadGetNameArgType) *CreateNetworkAreaPayload { this := CreateNetworkAreaPayload{} - this.AddressFamily = addressFamily - this.Name = name + setCreateNetworkAreaPayloadGetAddressFamilyAttributeType(&this.AddressFamily, addressFamily) + setCreateNetworkAreaPayloadGetNameAttributeType(&this.Name, name) return &this } @@ -50,92 +111,73 @@ func NewCreateNetworkAreaPayloadWithDefaults() *CreateNetworkAreaPayload { } // GetAddressFamily returns the AddressFamily field value -func (o *CreateNetworkAreaPayload) GetAddressFamily() *CreateAreaAddressFamily { - if o == nil || IsNil(o.AddressFamily) { - var ret *CreateAreaAddressFamily - return ret - } - - return o.AddressFamily +func (o *CreateNetworkAreaPayload) GetAddressFamily() (ret CreateNetworkAreaPayloadGetAddressFamilyRetType) { + ret, _ = o.GetAddressFamilyOk() + return ret } // GetAddressFamilyOk returns a tuple with the AddressFamily field value // and a boolean to check if the value has been set. -func (o *CreateNetworkAreaPayload) GetAddressFamilyOk() (*CreateAreaAddressFamily, bool) { - if o == nil { - return nil, false - } - return o.AddressFamily, true +func (o *CreateNetworkAreaPayload) GetAddressFamilyOk() (ret CreateNetworkAreaPayloadGetAddressFamilyRetType, ok bool) { + return getCreateNetworkAreaPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily) } // SetAddressFamily sets field value -func (o *CreateNetworkAreaPayload) SetAddressFamily(v *CreateAreaAddressFamily) { - o.AddressFamily = v +func (o *CreateNetworkAreaPayload) SetAddressFamily(v CreateNetworkAreaPayloadGetAddressFamilyRetType) { + setCreateNetworkAreaPayloadGetAddressFamilyAttributeType(&o.AddressFamily, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateNetworkAreaPayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *CreateNetworkAreaPayload) GetLabels() (res CreateNetworkAreaPayloadGetLabelsRetType) { + 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 *CreateNetworkAreaPayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *CreateNetworkAreaPayload) GetLabelsOk() (ret CreateNetworkAreaPayloadGetLabelsRetType, ok bool) { + return getCreateNetworkAreaPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *CreateNetworkAreaPayload) 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 *CreateNetworkAreaPayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *CreateNetworkAreaPayload) SetLabels(v CreateNetworkAreaPayloadGetLabelsRetType) { + setCreateNetworkAreaPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value -func (o *CreateNetworkAreaPayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *CreateNetworkAreaPayload) GetName() (ret CreateNetworkAreaPayloadGetNameRetType) { + 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 *CreateNetworkAreaPayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *CreateNetworkAreaPayload) GetNameOk() (ret CreateNetworkAreaPayloadGetNameRetType, ok bool) { + return getCreateNetworkAreaPayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *CreateNetworkAreaPayload) SetName(v *string) { - o.Name = v +func (o *CreateNetworkAreaPayload) SetName(v CreateNetworkAreaPayloadGetNameRetType) { + setCreateNetworkAreaPayloadGetNameAttributeType(&o.Name, v) } func (o CreateNetworkAreaPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["addressFamily"] = o.AddressFamily - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getCreateNetworkAreaPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily); ok { + toSerialize["AddressFamily"] = val + } + if val, ok := getCreateNetworkAreaPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getCreateNetworkAreaPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - toSerialize["name"] = o.Name return toSerialize, nil } diff --git a/services/iaas/model_create_network_area_range_payload.go b/services/iaas/model_create_network_area_range_payload.go index 837d3d22d..cef18afc6 100644 --- a/services/iaas/model_create_network_area_range_payload.go +++ b/services/iaas/model_create_network_area_range_payload.go @@ -17,10 +17,30 @@ import ( // checks if the CreateNetworkAreaRangePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateNetworkAreaRangePayload{} +/* + types and functions for ipv4 +*/ + +// isArray +type CreateNetworkAreaRangePayloadGetIpv4AttributeType = *[]NetworkRange +type CreateNetworkAreaRangePayloadGetIpv4ArgType = []NetworkRange +type CreateNetworkAreaRangePayloadGetIpv4RetType = []NetworkRange + +func getCreateNetworkAreaRangePayloadGetIpv4AttributeTypeOk(arg CreateNetworkAreaRangePayloadGetIpv4AttributeType) (ret CreateNetworkAreaRangePayloadGetIpv4RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkAreaRangePayloadGetIpv4AttributeType(arg *CreateNetworkAreaRangePayloadGetIpv4AttributeType, val CreateNetworkAreaRangePayloadGetIpv4RetType) { + *arg = &val +} + // CreateNetworkAreaRangePayload struct for CreateNetworkAreaRangePayload type CreateNetworkAreaRangePayload struct { // A list of network ranges. - Ipv4 *[]NetworkRange `json:"ipv4,omitempty"` + Ipv4 CreateNetworkAreaRangePayloadGetIpv4AttributeType `json:"ipv4,omitempty"` } // NewCreateNetworkAreaRangePayload instantiates a new CreateNetworkAreaRangePayload object @@ -41,41 +61,32 @@ func NewCreateNetworkAreaRangePayloadWithDefaults() *CreateNetworkAreaRangePaylo } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *CreateNetworkAreaRangePayload) GetIpv4() *[]NetworkRange { - if o == nil || IsNil(o.Ipv4) { - var ret *[]NetworkRange - return ret - } - return o.Ipv4 +func (o *CreateNetworkAreaRangePayload) GetIpv4() (res CreateNetworkAreaRangePayloadGetIpv4RetType) { + res, _ = o.GetIpv4Ok() + return } // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNetworkAreaRangePayload) GetIpv4Ok() (*[]NetworkRange, bool) { - if o == nil || IsNil(o.Ipv4) { - return nil, false - } - return o.Ipv4, true +func (o *CreateNetworkAreaRangePayload) GetIpv4Ok() (ret CreateNetworkAreaRangePayloadGetIpv4RetType, ok bool) { + return getCreateNetworkAreaRangePayloadGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. func (o *CreateNetworkAreaRangePayload) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { - return true - } - - return false + _, ok := o.GetIpv4Ok() + return ok } // SetIpv4 gets a reference to the given []NetworkRange and assigns it to the Ipv4 field. -func (o *CreateNetworkAreaRangePayload) SetIpv4(v *[]NetworkRange) { - o.Ipv4 = v +func (o *CreateNetworkAreaRangePayload) SetIpv4(v CreateNetworkAreaRangePayloadGetIpv4RetType) { + setCreateNetworkAreaRangePayloadGetIpv4AttributeType(&o.Ipv4, v) } func (o CreateNetworkAreaRangePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Ipv4) { - toSerialize["ipv4"] = o.Ipv4 + if val, ok := getCreateNetworkAreaRangePayloadGetIpv4AttributeTypeOk(o.Ipv4); ok { + toSerialize["Ipv4"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_network_area_route_payload.go b/services/iaas/model_create_network_area_route_payload.go index 26c47565f..6a2d5d968 100644 --- a/services/iaas/model_create_network_area_route_payload.go +++ b/services/iaas/model_create_network_area_route_payload.go @@ -17,10 +17,30 @@ import ( // checks if the CreateNetworkAreaRoutePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateNetworkAreaRoutePayload{} +/* + types and functions for ipv4 +*/ + +// isArray +type CreateNetworkAreaRoutePayloadGetIpv4AttributeType = *[]Route +type CreateNetworkAreaRoutePayloadGetIpv4ArgType = []Route +type CreateNetworkAreaRoutePayloadGetIpv4RetType = []Route + +func getCreateNetworkAreaRoutePayloadGetIpv4AttributeTypeOk(arg CreateNetworkAreaRoutePayloadGetIpv4AttributeType) (ret CreateNetworkAreaRoutePayloadGetIpv4RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkAreaRoutePayloadGetIpv4AttributeType(arg *CreateNetworkAreaRoutePayloadGetIpv4AttributeType, val CreateNetworkAreaRoutePayloadGetIpv4RetType) { + *arg = &val +} + // CreateNetworkAreaRoutePayload struct for CreateNetworkAreaRoutePayload type CreateNetworkAreaRoutePayload struct { // A list of routes. - Ipv4 *[]Route `json:"ipv4,omitempty"` + Ipv4 CreateNetworkAreaRoutePayloadGetIpv4AttributeType `json:"ipv4,omitempty"` } // NewCreateNetworkAreaRoutePayload instantiates a new CreateNetworkAreaRoutePayload object @@ -41,41 +61,32 @@ func NewCreateNetworkAreaRoutePayloadWithDefaults() *CreateNetworkAreaRoutePaylo } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *CreateNetworkAreaRoutePayload) GetIpv4() *[]Route { - if o == nil || IsNil(o.Ipv4) { - var ret *[]Route - return ret - } - return o.Ipv4 +func (o *CreateNetworkAreaRoutePayload) GetIpv4() (res CreateNetworkAreaRoutePayloadGetIpv4RetType) { + res, _ = o.GetIpv4Ok() + return } // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNetworkAreaRoutePayload) GetIpv4Ok() (*[]Route, bool) { - if o == nil || IsNil(o.Ipv4) { - return nil, false - } - return o.Ipv4, true +func (o *CreateNetworkAreaRoutePayload) GetIpv4Ok() (ret CreateNetworkAreaRoutePayloadGetIpv4RetType, ok bool) { + return getCreateNetworkAreaRoutePayloadGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. func (o *CreateNetworkAreaRoutePayload) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { - return true - } - - return false + _, ok := o.GetIpv4Ok() + return ok } // SetIpv4 gets a reference to the given []Route and assigns it to the Ipv4 field. -func (o *CreateNetworkAreaRoutePayload) SetIpv4(v *[]Route) { - o.Ipv4 = v +func (o *CreateNetworkAreaRoutePayload) SetIpv4(v CreateNetworkAreaRoutePayloadGetIpv4RetType) { + setCreateNetworkAreaRoutePayloadGetIpv4AttributeType(&o.Ipv4, v) } func (o CreateNetworkAreaRoutePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Ipv4) { - toSerialize["ipv4"] = o.Ipv4 + if val, ok := getCreateNetworkAreaRoutePayloadGetIpv4AttributeTypeOk(o.Ipv4); ok { + toSerialize["Ipv4"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_network_ipv4_body.go b/services/iaas/model_create_network_ipv4_body.go index cf1a8ad43..c808af3ae 100644 --- a/services/iaas/model_create_network_ipv4_body.go +++ b/services/iaas/model_create_network_ipv4_body.go @@ -17,15 +17,101 @@ import ( // checks if the CreateNetworkIPv4Body type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateNetworkIPv4Body{} +/* + types and functions for gateway +*/ + +// isNullableString +type CreateNetworkIPv4BodyGetGatewayAttributeType = *NullableString + +func getCreateNetworkIPv4BodyGetGatewayAttributeTypeOk(arg CreateNetworkIPv4BodyGetGatewayAttributeType) (ret CreateNetworkIPv4BodyGetGatewayRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setCreateNetworkIPv4BodyGetGatewayAttributeType(arg *CreateNetworkIPv4BodyGetGatewayAttributeType, val CreateNetworkIPv4BodyGetGatewayRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type CreateNetworkIPv4BodyGetGatewayArgType = *string +type CreateNetworkIPv4BodyGetGatewayRetType = *string + +/* + types and functions for nameservers +*/ + +// isArray +type CreateNetworkIPv4BodyGetNameserversAttributeType = *[]string +type CreateNetworkIPv4BodyGetNameserversArgType = []string +type CreateNetworkIPv4BodyGetNameserversRetType = []string + +func getCreateNetworkIPv4BodyGetNameserversAttributeTypeOk(arg CreateNetworkIPv4BodyGetNameserversAttributeType) (ret CreateNetworkIPv4BodyGetNameserversRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkIPv4BodyGetNameserversAttributeType(arg *CreateNetworkIPv4BodyGetNameserversAttributeType, val CreateNetworkIPv4BodyGetNameserversRetType) { + *arg = &val +} + +/* + types and functions for prefix +*/ + +// isNotNullableString +type CreateNetworkIPv4BodyGetPrefixAttributeType = *string + +func getCreateNetworkIPv4BodyGetPrefixAttributeTypeOk(arg CreateNetworkIPv4BodyGetPrefixAttributeType) (ret CreateNetworkIPv4BodyGetPrefixRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkIPv4BodyGetPrefixAttributeType(arg *CreateNetworkIPv4BodyGetPrefixAttributeType, val CreateNetworkIPv4BodyGetPrefixRetType) { + *arg = &val +} + +type CreateNetworkIPv4BodyGetPrefixArgType = string +type CreateNetworkIPv4BodyGetPrefixRetType = string + +/* + types and functions for prefixLength +*/ + +// isInteger +type CreateNetworkIPv4BodyGetPrefixLengthAttributeType = *int64 +type CreateNetworkIPv4BodyGetPrefixLengthArgType = int64 +type CreateNetworkIPv4BodyGetPrefixLengthRetType = int64 + +func getCreateNetworkIPv4BodyGetPrefixLengthAttributeTypeOk(arg CreateNetworkIPv4BodyGetPrefixLengthAttributeType) (ret CreateNetworkIPv4BodyGetPrefixLengthRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkIPv4BodyGetPrefixLengthAttributeType(arg *CreateNetworkIPv4BodyGetPrefixLengthAttributeType, val CreateNetworkIPv4BodyGetPrefixLengthRetType) { + *arg = &val +} + // CreateNetworkIPv4Body The config object for an IPv4 network. type CreateNetworkIPv4Body struct { // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. - Gateway *NullableString `json:"gateway,omitempty"` + Gateway CreateNetworkIPv4BodyGetGatewayAttributeType `json:"gateway,omitempty"` // A list containing DNS Servers/Nameservers for IPv4. - Nameservers *[]string `json:"nameservers,omitempty"` + Nameservers CreateNetworkIPv4BodyGetNameserversAttributeType `json:"nameservers,omitempty"` // Classless Inter-Domain Routing (CIDR). - Prefix *string `json:"prefix,omitempty"` - PrefixLength *int64 `json:"prefixLength,omitempty"` + Prefix CreateNetworkIPv4BodyGetPrefixAttributeType `json:"prefix,omitempty"` + PrefixLength CreateNetworkIPv4BodyGetPrefixLengthAttributeType `json:"prefixLength,omitempty"` } // NewCreateNetworkIPv4Body instantiates a new CreateNetworkIPv4Body object @@ -46,166 +132,121 @@ func NewCreateNetworkIPv4BodyWithDefaults() *CreateNetworkIPv4Body { } // GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateNetworkIPv4Body) GetGateway() *string { - if o == nil || IsNil(o.Gateway) || IsNil(o.Gateway.Get()) { - var ret *string - return ret - } - return o.Gateway.Get() +func (o *CreateNetworkIPv4Body) GetGateway() (res CreateNetworkIPv4BodyGetGatewayRetType) { + res, _ = o.GetGatewayOk() + return } // GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateNetworkIPv4Body) GetGatewayOk() (*string, bool) { - if o == nil || IsNil(o.Gateway) { - return nil, false - } - return o.Gateway.Get(), o.Gateway.IsSet() +func (o *CreateNetworkIPv4Body) GetGatewayOk() (ret CreateNetworkIPv4BodyGetGatewayRetType, ok bool) { + return getCreateNetworkIPv4BodyGetGatewayAttributeTypeOk(o.Gateway) } // HasGateway returns a boolean if a field has been set. func (o *CreateNetworkIPv4Body) HasGateway() bool { - if o != nil && !IsNil(o.Gateway) && o.Gateway.IsSet() { - return true - } - - return false + _, ok := o.GetGatewayOk() + return ok } // SetGateway gets a reference to the given string and assigns it to the Gateway field. -func (o *CreateNetworkIPv4Body) SetGateway(v *string) { - if IsNil(o.Gateway) { - o.Gateway = new(NullableString) - } - o.Gateway.Set(v) +func (o *CreateNetworkIPv4Body) SetGateway(v CreateNetworkIPv4BodyGetGatewayRetType) { + setCreateNetworkIPv4BodyGetGatewayAttributeType(&o.Gateway, v) } // SetGatewayNil sets the value for Gateway to be an explicit nil func (o *CreateNetworkIPv4Body) SetGatewayNil() { - if IsNil(o.Gateway) { - o.Gateway = new(NullableString) - } - o.Gateway.Set(nil) + o.Gateway = nil } // UnsetGateway ensures that no value is present for Gateway, not even an explicit nil func (o *CreateNetworkIPv4Body) UnsetGateway() { - if IsNil(o.Gateway) { - o.Gateway = new(NullableString) - } - o.Gateway.Unset() + o.Gateway = nil } // GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *CreateNetworkIPv4Body) GetNameservers() *[]string { - if o == nil || IsNil(o.Nameservers) { - var ret *[]string - return ret - } - return o.Nameservers +func (o *CreateNetworkIPv4Body) GetNameservers() (res CreateNetworkIPv4BodyGetNameserversRetType) { + res, _ = o.GetNameserversOk() + return } // GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNetworkIPv4Body) GetNameserversOk() (*[]string, bool) { - if o == nil || IsNil(o.Nameservers) { - return nil, false - } - return o.Nameservers, true +func (o *CreateNetworkIPv4Body) GetNameserversOk() (ret CreateNetworkIPv4BodyGetNameserversRetType, ok bool) { + return getCreateNetworkIPv4BodyGetNameserversAttributeTypeOk(o.Nameservers) } // HasNameservers returns a boolean if a field has been set. func (o *CreateNetworkIPv4Body) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { - return true - } - - return false + _, ok := o.GetNameserversOk() + return ok } // SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *CreateNetworkIPv4Body) SetNameservers(v *[]string) { - o.Nameservers = v +func (o *CreateNetworkIPv4Body) SetNameservers(v CreateNetworkIPv4BodyGetNameserversRetType) { + setCreateNetworkIPv4BodyGetNameserversAttributeType(&o.Nameservers, v) } // GetPrefix returns the Prefix field value if set, zero value otherwise. -func (o *CreateNetworkIPv4Body) GetPrefix() *string { - if o == nil || IsNil(o.Prefix) { - var ret *string - return ret - } - return o.Prefix +func (o *CreateNetworkIPv4Body) GetPrefix() (res CreateNetworkIPv4BodyGetPrefixRetType) { + res, _ = o.GetPrefixOk() + return } // GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNetworkIPv4Body) GetPrefixOk() (*string, bool) { - if o == nil || IsNil(o.Prefix) { - return nil, false - } - return o.Prefix, true +func (o *CreateNetworkIPv4Body) GetPrefixOk() (ret CreateNetworkIPv4BodyGetPrefixRetType, ok bool) { + return getCreateNetworkIPv4BodyGetPrefixAttributeTypeOk(o.Prefix) } // HasPrefix returns a boolean if a field has been set. func (o *CreateNetworkIPv4Body) HasPrefix() bool { - if o != nil && !IsNil(o.Prefix) { - return true - } - - return false + _, ok := o.GetPrefixOk() + return ok } // SetPrefix gets a reference to the given string and assigns it to the Prefix field. -func (o *CreateNetworkIPv4Body) SetPrefix(v *string) { - o.Prefix = v +func (o *CreateNetworkIPv4Body) SetPrefix(v CreateNetworkIPv4BodyGetPrefixRetType) { + setCreateNetworkIPv4BodyGetPrefixAttributeType(&o.Prefix, v) } // GetPrefixLength returns the PrefixLength field value if set, zero value otherwise. -func (o *CreateNetworkIPv4Body) GetPrefixLength() *int64 { - if o == nil || IsNil(o.PrefixLength) { - var ret *int64 - return ret - } - return o.PrefixLength +func (o *CreateNetworkIPv4Body) GetPrefixLength() (res CreateNetworkIPv4BodyGetPrefixLengthRetType) { + res, _ = o.GetPrefixLengthOk() + return } // GetPrefixLengthOk returns a tuple with the PrefixLength field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNetworkIPv4Body) GetPrefixLengthOk() (*int64, bool) { - if o == nil || IsNil(o.PrefixLength) { - return nil, false - } - return o.PrefixLength, true +func (o *CreateNetworkIPv4Body) GetPrefixLengthOk() (ret CreateNetworkIPv4BodyGetPrefixLengthRetType, ok bool) { + return getCreateNetworkIPv4BodyGetPrefixLengthAttributeTypeOk(o.PrefixLength) } // HasPrefixLength returns a boolean if a field has been set. func (o *CreateNetworkIPv4Body) HasPrefixLength() bool { - if o != nil && !IsNil(o.PrefixLength) { - return true - } - - return false + _, ok := o.GetPrefixLengthOk() + return ok } // SetPrefixLength gets a reference to the given int64 and assigns it to the PrefixLength field. -func (o *CreateNetworkIPv4Body) SetPrefixLength(v *int64) { - o.PrefixLength = v +func (o *CreateNetworkIPv4Body) SetPrefixLength(v CreateNetworkIPv4BodyGetPrefixLengthRetType) { + setCreateNetworkIPv4BodyGetPrefixLengthAttributeType(&o.PrefixLength, v) } func (o CreateNetworkIPv4Body) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Gateway.IsSet() { - toSerialize["gateway"] = o.Gateway.Get() + if val, ok := getCreateNetworkIPv4BodyGetGatewayAttributeTypeOk(o.Gateway); ok { + toSerialize["Gateway"] = val } - if !IsNil(o.Nameservers) { - toSerialize["nameservers"] = o.Nameservers + if val, ok := getCreateNetworkIPv4BodyGetNameserversAttributeTypeOk(o.Nameservers); ok { + toSerialize["Nameservers"] = val } - if !IsNil(o.Prefix) { - toSerialize["prefix"] = o.Prefix + if val, ok := getCreateNetworkIPv4BodyGetPrefixAttributeTypeOk(o.Prefix); ok { + toSerialize["Prefix"] = val } - if !IsNil(o.PrefixLength) { - toSerialize["prefixLength"] = o.PrefixLength + if val, ok := getCreateNetworkIPv4BodyGetPrefixLengthAttributeTypeOk(o.PrefixLength); ok { + toSerialize["PrefixLength"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_network_ipv6_body.go b/services/iaas/model_create_network_ipv6_body.go index 66f52b646..529c68ac2 100644 --- a/services/iaas/model_create_network_ipv6_body.go +++ b/services/iaas/model_create_network_ipv6_body.go @@ -17,15 +17,101 @@ import ( // checks if the CreateNetworkIPv6Body type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateNetworkIPv6Body{} +/* + types and functions for gateway +*/ + +// isNullableString +type CreateNetworkIPv6BodyGetGatewayAttributeType = *NullableString + +func getCreateNetworkIPv6BodyGetGatewayAttributeTypeOk(arg CreateNetworkIPv6BodyGetGatewayAttributeType) (ret CreateNetworkIPv6BodyGetGatewayRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setCreateNetworkIPv6BodyGetGatewayAttributeType(arg *CreateNetworkIPv6BodyGetGatewayAttributeType, val CreateNetworkIPv6BodyGetGatewayRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type CreateNetworkIPv6BodyGetGatewayArgType = *string +type CreateNetworkIPv6BodyGetGatewayRetType = *string + +/* + types and functions for nameservers +*/ + +// isArray +type CreateNetworkIPv6BodyGetNameserversAttributeType = *[]string +type CreateNetworkIPv6BodyGetNameserversArgType = []string +type CreateNetworkIPv6BodyGetNameserversRetType = []string + +func getCreateNetworkIPv6BodyGetNameserversAttributeTypeOk(arg CreateNetworkIPv6BodyGetNameserversAttributeType) (ret CreateNetworkIPv6BodyGetNameserversRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkIPv6BodyGetNameserversAttributeType(arg *CreateNetworkIPv6BodyGetNameserversAttributeType, val CreateNetworkIPv6BodyGetNameserversRetType) { + *arg = &val +} + +/* + types and functions for prefix +*/ + +// isNotNullableString +type CreateNetworkIPv6BodyGetPrefixAttributeType = *string + +func getCreateNetworkIPv6BodyGetPrefixAttributeTypeOk(arg CreateNetworkIPv6BodyGetPrefixAttributeType) (ret CreateNetworkIPv6BodyGetPrefixRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkIPv6BodyGetPrefixAttributeType(arg *CreateNetworkIPv6BodyGetPrefixAttributeType, val CreateNetworkIPv6BodyGetPrefixRetType) { + *arg = &val +} + +type CreateNetworkIPv6BodyGetPrefixArgType = string +type CreateNetworkIPv6BodyGetPrefixRetType = string + +/* + types and functions for prefixLength +*/ + +// isInteger +type CreateNetworkIPv6BodyGetPrefixLengthAttributeType = *int64 +type CreateNetworkIPv6BodyGetPrefixLengthArgType = int64 +type CreateNetworkIPv6BodyGetPrefixLengthRetType = int64 + +func getCreateNetworkIPv6BodyGetPrefixLengthAttributeTypeOk(arg CreateNetworkIPv6BodyGetPrefixLengthAttributeType) (ret CreateNetworkIPv6BodyGetPrefixLengthRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkIPv6BodyGetPrefixLengthAttributeType(arg *CreateNetworkIPv6BodyGetPrefixLengthAttributeType, val CreateNetworkIPv6BodyGetPrefixLengthRetType) { + *arg = &val +} + // CreateNetworkIPv6Body The config object for an IPv6 network. type CreateNetworkIPv6Body struct { // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. - Gateway *NullableString `json:"gateway,omitempty"` + Gateway CreateNetworkIPv6BodyGetGatewayAttributeType `json:"gateway,omitempty"` // A list containing DNS Servers/Nameservers for IPv6. - Nameservers *[]string `json:"nameservers,omitempty"` + Nameservers CreateNetworkIPv6BodyGetNameserversAttributeType `json:"nameservers,omitempty"` // Classless Inter-Domain Routing (CIDR) for IPv6. - Prefix *string `json:"prefix,omitempty"` - PrefixLength *int64 `json:"prefixLength,omitempty"` + Prefix CreateNetworkIPv6BodyGetPrefixAttributeType `json:"prefix,omitempty"` + PrefixLength CreateNetworkIPv6BodyGetPrefixLengthAttributeType `json:"prefixLength,omitempty"` } // NewCreateNetworkIPv6Body instantiates a new CreateNetworkIPv6Body object @@ -46,166 +132,121 @@ func NewCreateNetworkIPv6BodyWithDefaults() *CreateNetworkIPv6Body { } // GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreateNetworkIPv6Body) GetGateway() *string { - if o == nil || IsNil(o.Gateway) || IsNil(o.Gateway.Get()) { - var ret *string - return ret - } - return o.Gateway.Get() +func (o *CreateNetworkIPv6Body) GetGateway() (res CreateNetworkIPv6BodyGetGatewayRetType) { + res, _ = o.GetGatewayOk() + return } // GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateNetworkIPv6Body) GetGatewayOk() (*string, bool) { - if o == nil || IsNil(o.Gateway) { - return nil, false - } - return o.Gateway.Get(), o.Gateway.IsSet() +func (o *CreateNetworkIPv6Body) GetGatewayOk() (ret CreateNetworkIPv6BodyGetGatewayRetType, ok bool) { + return getCreateNetworkIPv6BodyGetGatewayAttributeTypeOk(o.Gateway) } // HasGateway returns a boolean if a field has been set. func (o *CreateNetworkIPv6Body) HasGateway() bool { - if o != nil && !IsNil(o.Gateway) && o.Gateway.IsSet() { - return true - } - - return false + _, ok := o.GetGatewayOk() + return ok } // SetGateway gets a reference to the given string and assigns it to the Gateway field. -func (o *CreateNetworkIPv6Body) SetGateway(v *string) { - if IsNil(o.Gateway) { - o.Gateway = new(NullableString) - } - o.Gateway.Set(v) +func (o *CreateNetworkIPv6Body) SetGateway(v CreateNetworkIPv6BodyGetGatewayRetType) { + setCreateNetworkIPv6BodyGetGatewayAttributeType(&o.Gateway, v) } // SetGatewayNil sets the value for Gateway to be an explicit nil func (o *CreateNetworkIPv6Body) SetGatewayNil() { - if IsNil(o.Gateway) { - o.Gateway = new(NullableString) - } - o.Gateway.Set(nil) + o.Gateway = nil } // UnsetGateway ensures that no value is present for Gateway, not even an explicit nil func (o *CreateNetworkIPv6Body) UnsetGateway() { - if IsNil(o.Gateway) { - o.Gateway = new(NullableString) - } - o.Gateway.Unset() + o.Gateway = nil } // GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *CreateNetworkIPv6Body) GetNameservers() *[]string { - if o == nil || IsNil(o.Nameservers) { - var ret *[]string - return ret - } - return o.Nameservers +func (o *CreateNetworkIPv6Body) GetNameservers() (res CreateNetworkIPv6BodyGetNameserversRetType) { + res, _ = o.GetNameserversOk() + return } // GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNetworkIPv6Body) GetNameserversOk() (*[]string, bool) { - if o == nil || IsNil(o.Nameservers) { - return nil, false - } - return o.Nameservers, true +func (o *CreateNetworkIPv6Body) GetNameserversOk() (ret CreateNetworkIPv6BodyGetNameserversRetType, ok bool) { + return getCreateNetworkIPv6BodyGetNameserversAttributeTypeOk(o.Nameservers) } // HasNameservers returns a boolean if a field has been set. func (o *CreateNetworkIPv6Body) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { - return true - } - - return false + _, ok := o.GetNameserversOk() + return ok } // SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *CreateNetworkIPv6Body) SetNameservers(v *[]string) { - o.Nameservers = v +func (o *CreateNetworkIPv6Body) SetNameservers(v CreateNetworkIPv6BodyGetNameserversRetType) { + setCreateNetworkIPv6BodyGetNameserversAttributeType(&o.Nameservers, v) } // GetPrefix returns the Prefix field value if set, zero value otherwise. -func (o *CreateNetworkIPv6Body) GetPrefix() *string { - if o == nil || IsNil(o.Prefix) { - var ret *string - return ret - } - return o.Prefix +func (o *CreateNetworkIPv6Body) GetPrefix() (res CreateNetworkIPv6BodyGetPrefixRetType) { + res, _ = o.GetPrefixOk() + return } // GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNetworkIPv6Body) GetPrefixOk() (*string, bool) { - if o == nil || IsNil(o.Prefix) { - return nil, false - } - return o.Prefix, true +func (o *CreateNetworkIPv6Body) GetPrefixOk() (ret CreateNetworkIPv6BodyGetPrefixRetType, ok bool) { + return getCreateNetworkIPv6BodyGetPrefixAttributeTypeOk(o.Prefix) } // HasPrefix returns a boolean if a field has been set. func (o *CreateNetworkIPv6Body) HasPrefix() bool { - if o != nil && !IsNil(o.Prefix) { - return true - } - - return false + _, ok := o.GetPrefixOk() + return ok } // SetPrefix gets a reference to the given string and assigns it to the Prefix field. -func (o *CreateNetworkIPv6Body) SetPrefix(v *string) { - o.Prefix = v +func (o *CreateNetworkIPv6Body) SetPrefix(v CreateNetworkIPv6BodyGetPrefixRetType) { + setCreateNetworkIPv6BodyGetPrefixAttributeType(&o.Prefix, v) } // GetPrefixLength returns the PrefixLength field value if set, zero value otherwise. -func (o *CreateNetworkIPv6Body) GetPrefixLength() *int64 { - if o == nil || IsNil(o.PrefixLength) { - var ret *int64 - return ret - } - return o.PrefixLength +func (o *CreateNetworkIPv6Body) GetPrefixLength() (res CreateNetworkIPv6BodyGetPrefixLengthRetType) { + res, _ = o.GetPrefixLengthOk() + return } // GetPrefixLengthOk returns a tuple with the PrefixLength field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNetworkIPv6Body) GetPrefixLengthOk() (*int64, bool) { - if o == nil || IsNil(o.PrefixLength) { - return nil, false - } - return o.PrefixLength, true +func (o *CreateNetworkIPv6Body) GetPrefixLengthOk() (ret CreateNetworkIPv6BodyGetPrefixLengthRetType, ok bool) { + return getCreateNetworkIPv6BodyGetPrefixLengthAttributeTypeOk(o.PrefixLength) } // HasPrefixLength returns a boolean if a field has been set. func (o *CreateNetworkIPv6Body) HasPrefixLength() bool { - if o != nil && !IsNil(o.PrefixLength) { - return true - } - - return false + _, ok := o.GetPrefixLengthOk() + return ok } // SetPrefixLength gets a reference to the given int64 and assigns it to the PrefixLength field. -func (o *CreateNetworkIPv6Body) SetPrefixLength(v *int64) { - o.PrefixLength = v +func (o *CreateNetworkIPv6Body) SetPrefixLength(v CreateNetworkIPv6BodyGetPrefixLengthRetType) { + setCreateNetworkIPv6BodyGetPrefixLengthAttributeType(&o.PrefixLength, v) } func (o CreateNetworkIPv6Body) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Gateway.IsSet() { - toSerialize["gateway"] = o.Gateway.Get() + if val, ok := getCreateNetworkIPv6BodyGetGatewayAttributeTypeOk(o.Gateway); ok { + toSerialize["Gateway"] = val } - if !IsNil(o.Nameservers) { - toSerialize["nameservers"] = o.Nameservers + if val, ok := getCreateNetworkIPv6BodyGetNameserversAttributeTypeOk(o.Nameservers); ok { + toSerialize["Nameservers"] = val } - if !IsNil(o.Prefix) { - toSerialize["prefix"] = o.Prefix + if val, ok := getCreateNetworkIPv6BodyGetPrefixAttributeTypeOk(o.Prefix); ok { + toSerialize["Prefix"] = val } - if !IsNil(o.PrefixLength) { - toSerialize["prefixLength"] = o.PrefixLength + if val, ok := getCreateNetworkIPv6BodyGetPrefixLengthAttributeTypeOk(o.PrefixLength); ok { + toSerialize["PrefixLength"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_network_payload.go b/services/iaas/model_create_network_payload.go index e79a1cd68..fd24a53ff 100644 --- a/services/iaas/model_create_network_payload.go +++ b/services/iaas/model_create_network_payload.go @@ -17,16 +17,97 @@ import ( // checks if the CreateNetworkPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateNetworkPayload{} +/* + types and functions for addressFamily +*/ + +// isModel +type CreateNetworkPayloadGetAddressFamilyAttributeType = *CreateNetworkAddressFamily +type CreateNetworkPayloadGetAddressFamilyArgType = CreateNetworkAddressFamily +type CreateNetworkPayloadGetAddressFamilyRetType = CreateNetworkAddressFamily + +func getCreateNetworkPayloadGetAddressFamilyAttributeTypeOk(arg CreateNetworkPayloadGetAddressFamilyAttributeType) (ret CreateNetworkPayloadGetAddressFamilyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkPayloadGetAddressFamilyAttributeType(arg *CreateNetworkPayloadGetAddressFamilyAttributeType, val CreateNetworkPayloadGetAddressFamilyRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isFreeform +type CreateNetworkPayloadGetLabelsAttributeType = *map[string]interface{} +type CreateNetworkPayloadGetLabelsArgType = map[string]interface{} +type CreateNetworkPayloadGetLabelsRetType = map[string]interface{} + +func getCreateNetworkPayloadGetLabelsAttributeTypeOk(arg CreateNetworkPayloadGetLabelsAttributeType) (ret CreateNetworkPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkPayloadGetLabelsAttributeType(arg *CreateNetworkPayloadGetLabelsAttributeType, val CreateNetworkPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateNetworkPayloadGetNameAttributeType = *string + +func getCreateNetworkPayloadGetNameAttributeTypeOk(arg CreateNetworkPayloadGetNameAttributeType) (ret CreateNetworkPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkPayloadGetNameAttributeType(arg *CreateNetworkPayloadGetNameAttributeType, val CreateNetworkPayloadGetNameRetType) { + *arg = &val +} + +type CreateNetworkPayloadGetNameArgType = string +type CreateNetworkPayloadGetNameRetType = string + +/* + types and functions for routed +*/ + +// isBoolean +type CreateNetworkPayloadgetRoutedAttributeType = *bool +type CreateNetworkPayloadgetRoutedArgType = bool +type CreateNetworkPayloadgetRoutedRetType = bool + +func getCreateNetworkPayloadgetRoutedAttributeTypeOk(arg CreateNetworkPayloadgetRoutedAttributeType) (ret CreateNetworkPayloadgetRoutedRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkPayloadgetRoutedAttributeType(arg *CreateNetworkPayloadgetRoutedAttributeType, val CreateNetworkPayloadgetRoutedRetType) { + *arg = &val +} + // CreateNetworkPayload Object that represents the request body for a network create. type CreateNetworkPayload struct { - AddressFamily *CreateNetworkAddressFamily `json:"addressFamily,omitempty"` + AddressFamily CreateNetworkPayloadGetAddressFamilyAttributeType `json:"addressFamily,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels CreateNetworkPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED - Name *string `json:"name"` + Name CreateNetworkPayloadGetNameAttributeType `json:"name"` // Shows if the network is routed and therefore accessible from other networks. - Routed *bool `json:"routed,omitempty"` + Routed CreateNetworkPayloadgetRoutedAttributeType `json:"routed,omitempty"` } type _CreateNetworkPayload CreateNetworkPayload @@ -35,9 +116,9 @@ type _CreateNetworkPayload CreateNetworkPayload // 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 NewCreateNetworkPayload(name *string) *CreateNetworkPayload { +func NewCreateNetworkPayload(name CreateNetworkPayloadGetNameArgType) *CreateNetworkPayload { this := CreateNetworkPayload{} - this.Name = name + setCreateNetworkPayloadGetNameAttributeType(&this.Name, name) return &this } @@ -50,136 +131,104 @@ func NewCreateNetworkPayloadWithDefaults() *CreateNetworkPayload { } // GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. -func (o *CreateNetworkPayload) GetAddressFamily() *CreateNetworkAddressFamily { - if o == nil || IsNil(o.AddressFamily) { - var ret *CreateNetworkAddressFamily - return ret - } - return o.AddressFamily +func (o *CreateNetworkPayload) GetAddressFamily() (res CreateNetworkPayloadGetAddressFamilyRetType) { + res, _ = o.GetAddressFamilyOk() + return } // GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNetworkPayload) GetAddressFamilyOk() (*CreateNetworkAddressFamily, bool) { - if o == nil || IsNil(o.AddressFamily) { - return nil, false - } - return o.AddressFamily, true +func (o *CreateNetworkPayload) GetAddressFamilyOk() (ret CreateNetworkPayloadGetAddressFamilyRetType, ok bool) { + return getCreateNetworkPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily) } // HasAddressFamily returns a boolean if a field has been set. func (o *CreateNetworkPayload) HasAddressFamily() bool { - if o != nil && !IsNil(o.AddressFamily) { - return true - } - - return false + _, ok := o.GetAddressFamilyOk() + return ok } // SetAddressFamily gets a reference to the given CreateNetworkAddressFamily and assigns it to the AddressFamily field. -func (o *CreateNetworkPayload) SetAddressFamily(v *CreateNetworkAddressFamily) { - o.AddressFamily = v +func (o *CreateNetworkPayload) SetAddressFamily(v CreateNetworkPayloadGetAddressFamilyRetType) { + setCreateNetworkPayloadGetAddressFamilyAttributeType(&o.AddressFamily, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateNetworkPayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *CreateNetworkPayload) GetLabels() (res CreateNetworkPayloadGetLabelsRetType) { + 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 *CreateNetworkPayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *CreateNetworkPayload) GetLabelsOk() (ret CreateNetworkPayloadGetLabelsRetType, ok bool) { + return getCreateNetworkPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *CreateNetworkPayload) 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 *CreateNetworkPayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *CreateNetworkPayload) SetLabels(v CreateNetworkPayloadGetLabelsRetType) { + setCreateNetworkPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value -func (o *CreateNetworkPayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *CreateNetworkPayload) GetName() (ret CreateNetworkPayloadGetNameRetType) { + 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 *CreateNetworkPayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *CreateNetworkPayload) GetNameOk() (ret CreateNetworkPayloadGetNameRetType, ok bool) { + return getCreateNetworkPayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *CreateNetworkPayload) SetName(v *string) { - o.Name = v +func (o *CreateNetworkPayload) SetName(v CreateNetworkPayloadGetNameRetType) { + setCreateNetworkPayloadGetNameAttributeType(&o.Name, v) } // GetRouted returns the Routed field value if set, zero value otherwise. -func (o *CreateNetworkPayload) GetRouted() *bool { - if o == nil || IsNil(o.Routed) { - var ret *bool - return ret - } - return o.Routed +func (o *CreateNetworkPayload) GetRouted() (res CreateNetworkPayloadgetRoutedRetType) { + res, _ = o.GetRoutedOk() + return } // GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNetworkPayload) GetRoutedOk() (*bool, bool) { - if o == nil || IsNil(o.Routed) { - return nil, false - } - return o.Routed, true +func (o *CreateNetworkPayload) GetRoutedOk() (ret CreateNetworkPayloadgetRoutedRetType, ok bool) { + return getCreateNetworkPayloadgetRoutedAttributeTypeOk(o.Routed) } // HasRouted returns a boolean if a field has been set. func (o *CreateNetworkPayload) HasRouted() bool { - if o != nil && !IsNil(o.Routed) { - return true - } - - return false + _, ok := o.GetRoutedOk() + return ok } // SetRouted gets a reference to the given bool and assigns it to the Routed field. -func (o *CreateNetworkPayload) SetRouted(v *bool) { - o.Routed = v +func (o *CreateNetworkPayload) SetRouted(v CreateNetworkPayloadgetRoutedRetType) { + setCreateNetworkPayloadgetRoutedAttributeType(&o.Routed, v) } func (o CreateNetworkPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.AddressFamily) { - toSerialize["addressFamily"] = o.AddressFamily + if val, ok := getCreateNetworkPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily); ok { + toSerialize["AddressFamily"] = val + } + if val, ok := getCreateNetworkPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getCreateNetworkPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - toSerialize["name"] = o.Name - if !IsNil(o.Routed) { - toSerialize["routed"] = o.Routed + if val, ok := getCreateNetworkPayloadgetRoutedAttributeTypeOk(o.Routed); ok { + toSerialize["Routed"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_nic_payload.go b/services/iaas/model_create_nic_payload.go index 54916f4e6..8cb9c0806 100644 --- a/services/iaas/model_create_nic_payload.go +++ b/services/iaas/model_create_nic_payload.go @@ -17,32 +17,301 @@ import ( // checks if the CreateNicPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateNicPayload{} +/* + types and functions for allowedAddresses +*/ + +// isArray +type CreateNicPayloadGetAllowedAddressesAttributeType = *[]AllowedAddressesInner +type CreateNicPayloadGetAllowedAddressesArgType = []AllowedAddressesInner +type CreateNicPayloadGetAllowedAddressesRetType = []AllowedAddressesInner + +func getCreateNicPayloadGetAllowedAddressesAttributeTypeOk(arg CreateNicPayloadGetAllowedAddressesAttributeType) (ret CreateNicPayloadGetAllowedAddressesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNicPayloadGetAllowedAddressesAttributeType(arg *CreateNicPayloadGetAllowedAddressesAttributeType, val CreateNicPayloadGetAllowedAddressesRetType) { + *arg = &val +} + +/* + types and functions for device +*/ + +// isNotNullableString +type CreateNicPayloadGetDeviceAttributeType = *string + +func getCreateNicPayloadGetDeviceAttributeTypeOk(arg CreateNicPayloadGetDeviceAttributeType) (ret CreateNicPayloadGetDeviceRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNicPayloadGetDeviceAttributeType(arg *CreateNicPayloadGetDeviceAttributeType, val CreateNicPayloadGetDeviceRetType) { + *arg = &val +} + +type CreateNicPayloadGetDeviceArgType = string +type CreateNicPayloadGetDeviceRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type CreateNicPayloadGetIdAttributeType = *string + +func getCreateNicPayloadGetIdAttributeTypeOk(arg CreateNicPayloadGetIdAttributeType) (ret CreateNicPayloadGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNicPayloadGetIdAttributeType(arg *CreateNicPayloadGetIdAttributeType, val CreateNicPayloadGetIdRetType) { + *arg = &val +} + +type CreateNicPayloadGetIdArgType = string +type CreateNicPayloadGetIdRetType = string + +/* + types and functions for ipv4 +*/ + +// isNotNullableString +type CreateNicPayloadGetIpv4AttributeType = *string + +func getCreateNicPayloadGetIpv4AttributeTypeOk(arg CreateNicPayloadGetIpv4AttributeType) (ret CreateNicPayloadGetIpv4RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNicPayloadGetIpv4AttributeType(arg *CreateNicPayloadGetIpv4AttributeType, val CreateNicPayloadGetIpv4RetType) { + *arg = &val +} + +type CreateNicPayloadGetIpv4ArgType = string +type CreateNicPayloadGetIpv4RetType = string + +/* + types and functions for ipv6 +*/ + +// isNotNullableString +type CreateNicPayloadGetIpv6AttributeType = *string + +func getCreateNicPayloadGetIpv6AttributeTypeOk(arg CreateNicPayloadGetIpv6AttributeType) (ret CreateNicPayloadGetIpv6RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNicPayloadGetIpv6AttributeType(arg *CreateNicPayloadGetIpv6AttributeType, val CreateNicPayloadGetIpv6RetType) { + *arg = &val +} + +type CreateNicPayloadGetIpv6ArgType = string +type CreateNicPayloadGetIpv6RetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type CreateNicPayloadGetLabelsAttributeType = *map[string]interface{} +type CreateNicPayloadGetLabelsArgType = map[string]interface{} +type CreateNicPayloadGetLabelsRetType = map[string]interface{} + +func getCreateNicPayloadGetLabelsAttributeTypeOk(arg CreateNicPayloadGetLabelsAttributeType) (ret CreateNicPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNicPayloadGetLabelsAttributeType(arg *CreateNicPayloadGetLabelsAttributeType, val CreateNicPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for mac +*/ + +// isNotNullableString +type CreateNicPayloadGetMacAttributeType = *string + +func getCreateNicPayloadGetMacAttributeTypeOk(arg CreateNicPayloadGetMacAttributeType) (ret CreateNicPayloadGetMacRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNicPayloadGetMacAttributeType(arg *CreateNicPayloadGetMacAttributeType, val CreateNicPayloadGetMacRetType) { + *arg = &val +} + +type CreateNicPayloadGetMacArgType = string +type CreateNicPayloadGetMacRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateNicPayloadGetNameAttributeType = *string + +func getCreateNicPayloadGetNameAttributeTypeOk(arg CreateNicPayloadGetNameAttributeType) (ret CreateNicPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNicPayloadGetNameAttributeType(arg *CreateNicPayloadGetNameAttributeType, val CreateNicPayloadGetNameRetType) { + *arg = &val +} + +type CreateNicPayloadGetNameArgType = string +type CreateNicPayloadGetNameRetType = string + +/* + types and functions for networkId +*/ + +// isNotNullableString +type CreateNicPayloadGetNetworkIdAttributeType = *string + +func getCreateNicPayloadGetNetworkIdAttributeTypeOk(arg CreateNicPayloadGetNetworkIdAttributeType) (ret CreateNicPayloadGetNetworkIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNicPayloadGetNetworkIdAttributeType(arg *CreateNicPayloadGetNetworkIdAttributeType, val CreateNicPayloadGetNetworkIdRetType) { + *arg = &val +} + +type CreateNicPayloadGetNetworkIdArgType = string +type CreateNicPayloadGetNetworkIdRetType = string + +/* + types and functions for nicSecurity +*/ + +// isBoolean +type CreateNicPayloadgetNicSecurityAttributeType = *bool +type CreateNicPayloadgetNicSecurityArgType = bool +type CreateNicPayloadgetNicSecurityRetType = bool + +func getCreateNicPayloadgetNicSecurityAttributeTypeOk(arg CreateNicPayloadgetNicSecurityAttributeType) (ret CreateNicPayloadgetNicSecurityRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNicPayloadgetNicSecurityAttributeType(arg *CreateNicPayloadgetNicSecurityAttributeType, val CreateNicPayloadgetNicSecurityRetType) { + *arg = &val +} + +/* + types and functions for securityGroups +*/ + +// isArray +type CreateNicPayloadGetSecurityGroupsAttributeType = *[]string +type CreateNicPayloadGetSecurityGroupsArgType = []string +type CreateNicPayloadGetSecurityGroupsRetType = []string + +func getCreateNicPayloadGetSecurityGroupsAttributeTypeOk(arg CreateNicPayloadGetSecurityGroupsAttributeType) (ret CreateNicPayloadGetSecurityGroupsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNicPayloadGetSecurityGroupsAttributeType(arg *CreateNicPayloadGetSecurityGroupsAttributeType, val CreateNicPayloadGetSecurityGroupsRetType) { + *arg = &val +} + +/* + types and functions for status +*/ + +// isNotNullableString +type CreateNicPayloadGetStatusAttributeType = *string + +func getCreateNicPayloadGetStatusAttributeTypeOk(arg CreateNicPayloadGetStatusAttributeType) (ret CreateNicPayloadGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNicPayloadGetStatusAttributeType(arg *CreateNicPayloadGetStatusAttributeType, val CreateNicPayloadGetStatusRetType) { + *arg = &val +} + +type CreateNicPayloadGetStatusArgType = string +type CreateNicPayloadGetStatusRetType = string + +/* + types and functions for type +*/ + +// isNotNullableString +type CreateNicPayloadGetTypeAttributeType = *string + +func getCreateNicPayloadGetTypeAttributeTypeOk(arg CreateNicPayloadGetTypeAttributeType) (ret CreateNicPayloadGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNicPayloadGetTypeAttributeType(arg *CreateNicPayloadGetTypeAttributeType, val CreateNicPayloadGetTypeRetType) { + *arg = &val +} + +type CreateNicPayloadGetTypeArgType = string +type CreateNicPayloadGetTypeRetType = string + // CreateNicPayload Object that represents a network interface. type CreateNicPayload struct { // A list of IPs or CIDR notations. - AllowedAddresses *[]AllowedAddressesInner `json:"allowedAddresses,omitempty"` + AllowedAddresses CreateNicPayloadGetAllowedAddressesAttributeType `json:"allowedAddresses,omitempty"` // Universally Unique Identifier (UUID). - Device *string `json:"device,omitempty"` + Device CreateNicPayloadGetDeviceAttributeType `json:"device,omitempty"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id CreateNicPayloadGetIdAttributeType `json:"id,omitempty"` // Object that represents an IP address. - Ipv4 *string `json:"ipv4,omitempty"` + Ipv4 CreateNicPayloadGetIpv4AttributeType `json:"ipv4,omitempty"` // Object that represents an IPv6 address. - Ipv6 *string `json:"ipv6,omitempty"` + Ipv6 CreateNicPayloadGetIpv6AttributeType `json:"ipv6,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels CreateNicPayloadGetLabelsAttributeType `json:"labels,omitempty"` // Object that represents an MAC address. - Mac *string `json:"mac,omitempty"` + Mac CreateNicPayloadGetMacAttributeType `json:"mac,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty"` + Name CreateNicPayloadGetNameAttributeType `json:"name,omitempty"` // Universally Unique Identifier (UUID). - NetworkId *string `json:"networkId,omitempty"` + NetworkId CreateNicPayloadGetNetworkIdAttributeType `json:"networkId,omitempty"` // If this is set to false, then no security groups will apply to this network interface. - NicSecurity *bool `json:"nicSecurity,omitempty"` + NicSecurity CreateNicPayloadgetNicSecurityAttributeType `json:"nicSecurity,omitempty"` // A list of UUIDs. - SecurityGroups *[]string `json:"securityGroups,omitempty"` - Status *string `json:"status,omitempty"` - Type *string `json:"type,omitempty"` + SecurityGroups CreateNicPayloadGetSecurityGroupsAttributeType `json:"securityGroups,omitempty"` + Status CreateNicPayloadGetStatusAttributeType `json:"status,omitempty"` + Type CreateNicPayloadGetTypeAttributeType `json:"type,omitempty"` } // NewCreateNicPayload instantiates a new CreateNicPayload object @@ -51,8 +320,6 @@ type CreateNicPayload struct { // will change when the set of required properties is changed func NewCreateNicPayload() *CreateNicPayload { this := CreateNicPayload{} - var nicSecurity bool = true - this.NicSecurity = &nicSecurity return &this } @@ -67,461 +334,344 @@ func NewCreateNicPayloadWithDefaults() *CreateNicPayload { } // GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. -func (o *CreateNicPayload) GetAllowedAddresses() *[]AllowedAddressesInner { - if o == nil || IsNil(o.AllowedAddresses) { - var ret *[]AllowedAddressesInner - return ret - } - return o.AllowedAddresses +func (o *CreateNicPayload) GetAllowedAddresses() (res CreateNicPayloadGetAllowedAddressesRetType) { + res, _ = o.GetAllowedAddressesOk() + return } // GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNicPayload) GetAllowedAddressesOk() (*[]AllowedAddressesInner, bool) { - if o == nil || IsNil(o.AllowedAddresses) { - return nil, false - } - return o.AllowedAddresses, true +func (o *CreateNicPayload) GetAllowedAddressesOk() (ret CreateNicPayloadGetAllowedAddressesRetType, ok bool) { + return getCreateNicPayloadGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses) } // HasAllowedAddresses returns a boolean if a field has been set. func (o *CreateNicPayload) HasAllowedAddresses() bool { - if o != nil && !IsNil(o.AllowedAddresses) { - return true - } - - return false + _, ok := o.GetAllowedAddressesOk() + return ok } // SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. -func (o *CreateNicPayload) SetAllowedAddresses(v *[]AllowedAddressesInner) { - o.AllowedAddresses = v +func (o *CreateNicPayload) SetAllowedAddresses(v CreateNicPayloadGetAllowedAddressesRetType) { + setCreateNicPayloadGetAllowedAddressesAttributeType(&o.AllowedAddresses, v) } // GetDevice returns the Device field value if set, zero value otherwise. -func (o *CreateNicPayload) GetDevice() *string { - if o == nil || IsNil(o.Device) { - var ret *string - return ret - } - return o.Device +func (o *CreateNicPayload) GetDevice() (res CreateNicPayloadGetDeviceRetType) { + res, _ = o.GetDeviceOk() + return } // GetDeviceOk returns a tuple with the Device field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNicPayload) GetDeviceOk() (*string, bool) { - if o == nil || IsNil(o.Device) { - return nil, false - } - return o.Device, true +func (o *CreateNicPayload) GetDeviceOk() (ret CreateNicPayloadGetDeviceRetType, ok bool) { + return getCreateNicPayloadGetDeviceAttributeTypeOk(o.Device) } // HasDevice returns a boolean if a field has been set. func (o *CreateNicPayload) HasDevice() bool { - if o != nil && !IsNil(o.Device) { - return true - } - - return false + _, ok := o.GetDeviceOk() + return ok } // SetDevice gets a reference to the given string and assigns it to the Device field. -func (o *CreateNicPayload) SetDevice(v *string) { - o.Device = v +func (o *CreateNicPayload) SetDevice(v CreateNicPayloadGetDeviceRetType) { + setCreateNicPayloadGetDeviceAttributeType(&o.Device, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *CreateNicPayload) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *CreateNicPayload) GetId() (res CreateNicPayloadGetIdRetType) { + 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 *CreateNicPayload) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *CreateNicPayload) GetIdOk() (ret CreateNicPayloadGetIdRetType, ok bool) { + return getCreateNicPayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *CreateNicPayload) 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 *CreateNicPayload) SetId(v *string) { - o.Id = v +func (o *CreateNicPayload) SetId(v CreateNicPayloadGetIdRetType) { + setCreateNicPayloadGetIdAttributeType(&o.Id, v) } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *CreateNicPayload) GetIpv4() *string { - if o == nil || IsNil(o.Ipv4) { - var ret *string - return ret - } - return o.Ipv4 +func (o *CreateNicPayload) GetIpv4() (res CreateNicPayloadGetIpv4RetType) { + res, _ = o.GetIpv4Ok() + return } // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNicPayload) GetIpv4Ok() (*string, bool) { - if o == nil || IsNil(o.Ipv4) { - return nil, false - } - return o.Ipv4, true +func (o *CreateNicPayload) GetIpv4Ok() (ret CreateNicPayloadGetIpv4RetType, ok bool) { + return getCreateNicPayloadGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. func (o *CreateNicPayload) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { - return true - } - - return false + _, ok := o.GetIpv4Ok() + return ok } // SetIpv4 gets a reference to the given string and assigns it to the Ipv4 field. -func (o *CreateNicPayload) SetIpv4(v *string) { - o.Ipv4 = v +func (o *CreateNicPayload) SetIpv4(v CreateNicPayloadGetIpv4RetType) { + setCreateNicPayloadGetIpv4AttributeType(&o.Ipv4, v) } // GetIpv6 returns the Ipv6 field value if set, zero value otherwise. -func (o *CreateNicPayload) GetIpv6() *string { - if o == nil || IsNil(o.Ipv6) { - var ret *string - return ret - } - return o.Ipv6 +func (o *CreateNicPayload) GetIpv6() (res CreateNicPayloadGetIpv6RetType) { + res, _ = o.GetIpv6Ok() + return } // GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNicPayload) GetIpv6Ok() (*string, bool) { - if o == nil || IsNil(o.Ipv6) { - return nil, false - } - return o.Ipv6, true +func (o *CreateNicPayload) GetIpv6Ok() (ret CreateNicPayloadGetIpv6RetType, ok bool) { + return getCreateNicPayloadGetIpv6AttributeTypeOk(o.Ipv6) } // HasIpv6 returns a boolean if a field has been set. func (o *CreateNicPayload) HasIpv6() bool { - if o != nil && !IsNil(o.Ipv6) { - return true - } - - return false + _, ok := o.GetIpv6Ok() + return ok } // SetIpv6 gets a reference to the given string and assigns it to the Ipv6 field. -func (o *CreateNicPayload) SetIpv6(v *string) { - o.Ipv6 = v +func (o *CreateNicPayload) SetIpv6(v CreateNicPayloadGetIpv6RetType) { + setCreateNicPayloadGetIpv6AttributeType(&o.Ipv6, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateNicPayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *CreateNicPayload) GetLabels() (res CreateNicPayloadGetLabelsRetType) { + 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 *CreateNicPayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *CreateNicPayload) GetLabelsOk() (ret CreateNicPayloadGetLabelsRetType, ok bool) { + return getCreateNicPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *CreateNicPayload) 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 *CreateNicPayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *CreateNicPayload) SetLabels(v CreateNicPayloadGetLabelsRetType) { + setCreateNicPayloadGetLabelsAttributeType(&o.Labels, v) } // GetMac returns the Mac field value if set, zero value otherwise. -func (o *CreateNicPayload) GetMac() *string { - if o == nil || IsNil(o.Mac) { - var ret *string - return ret - } - return o.Mac +func (o *CreateNicPayload) GetMac() (res CreateNicPayloadGetMacRetType) { + res, _ = o.GetMacOk() + return } // GetMacOk returns a tuple with the Mac field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNicPayload) GetMacOk() (*string, bool) { - if o == nil || IsNil(o.Mac) { - return nil, false - } - return o.Mac, true +func (o *CreateNicPayload) GetMacOk() (ret CreateNicPayloadGetMacRetType, ok bool) { + return getCreateNicPayloadGetMacAttributeTypeOk(o.Mac) } // HasMac returns a boolean if a field has been set. func (o *CreateNicPayload) HasMac() bool { - if o != nil && !IsNil(o.Mac) { - return true - } - - return false + _, ok := o.GetMacOk() + return ok } // SetMac gets a reference to the given string and assigns it to the Mac field. -func (o *CreateNicPayload) SetMac(v *string) { - o.Mac = v +func (o *CreateNicPayload) SetMac(v CreateNicPayloadGetMacRetType) { + setCreateNicPayloadGetMacAttributeType(&o.Mac, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *CreateNicPayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *CreateNicPayload) GetName() (res CreateNicPayloadGetNameRetType) { + 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 *CreateNicPayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *CreateNicPayload) GetNameOk() (ret CreateNicPayloadGetNameRetType, ok bool) { + return getCreateNicPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *CreateNicPayload) 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 *CreateNicPayload) SetName(v *string) { - o.Name = v +func (o *CreateNicPayload) SetName(v CreateNicPayloadGetNameRetType) { + setCreateNicPayloadGetNameAttributeType(&o.Name, v) } // GetNetworkId returns the NetworkId field value if set, zero value otherwise. -func (o *CreateNicPayload) GetNetworkId() *string { - if o == nil || IsNil(o.NetworkId) { - var ret *string - return ret - } - return o.NetworkId +func (o *CreateNicPayload) GetNetworkId() (res CreateNicPayloadGetNetworkIdRetType) { + res, _ = o.GetNetworkIdOk() + return } // GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNicPayload) GetNetworkIdOk() (*string, bool) { - if o == nil || IsNil(o.NetworkId) { - return nil, false - } - return o.NetworkId, true +func (o *CreateNicPayload) GetNetworkIdOk() (ret CreateNicPayloadGetNetworkIdRetType, ok bool) { + return getCreateNicPayloadGetNetworkIdAttributeTypeOk(o.NetworkId) } // HasNetworkId returns a boolean if a field has been set. func (o *CreateNicPayload) HasNetworkId() bool { - if o != nil && !IsNil(o.NetworkId) { - return true - } - - return false + _, ok := o.GetNetworkIdOk() + return ok } // SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. -func (o *CreateNicPayload) SetNetworkId(v *string) { - o.NetworkId = v +func (o *CreateNicPayload) SetNetworkId(v CreateNicPayloadGetNetworkIdRetType) { + setCreateNicPayloadGetNetworkIdAttributeType(&o.NetworkId, v) } // GetNicSecurity returns the NicSecurity field value if set, zero value otherwise. -func (o *CreateNicPayload) GetNicSecurity() *bool { - if o == nil || IsNil(o.NicSecurity) { - var ret *bool - return ret - } - return o.NicSecurity +func (o *CreateNicPayload) GetNicSecurity() (res CreateNicPayloadgetNicSecurityRetType) { + res, _ = o.GetNicSecurityOk() + return } // GetNicSecurityOk returns a tuple with the NicSecurity field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNicPayload) GetNicSecurityOk() (*bool, bool) { - if o == nil || IsNil(o.NicSecurity) { - return nil, false - } - return o.NicSecurity, true +func (o *CreateNicPayload) GetNicSecurityOk() (ret CreateNicPayloadgetNicSecurityRetType, ok bool) { + return getCreateNicPayloadgetNicSecurityAttributeTypeOk(o.NicSecurity) } // HasNicSecurity returns a boolean if a field has been set. func (o *CreateNicPayload) HasNicSecurity() bool { - if o != nil && !IsNil(o.NicSecurity) { - return true - } - - return false + _, ok := o.GetNicSecurityOk() + return ok } // SetNicSecurity gets a reference to the given bool and assigns it to the NicSecurity field. -func (o *CreateNicPayload) SetNicSecurity(v *bool) { - o.NicSecurity = v +func (o *CreateNicPayload) SetNicSecurity(v CreateNicPayloadgetNicSecurityRetType) { + setCreateNicPayloadgetNicSecurityAttributeType(&o.NicSecurity, v) } // GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. -func (o *CreateNicPayload) GetSecurityGroups() *[]string { - if o == nil || IsNil(o.SecurityGroups) { - var ret *[]string - return ret - } - return o.SecurityGroups +func (o *CreateNicPayload) GetSecurityGroups() (res CreateNicPayloadGetSecurityGroupsRetType) { + res, _ = o.GetSecurityGroupsOk() + return } // GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateNicPayload) GetSecurityGroupsOk() (*[]string, bool) { - if o == nil || IsNil(o.SecurityGroups) { - return nil, false - } - return o.SecurityGroups, true +func (o *CreateNicPayload) GetSecurityGroupsOk() (ret CreateNicPayloadGetSecurityGroupsRetType, ok bool) { + return getCreateNicPayloadGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) } // HasSecurityGroups returns a boolean if a field has been set. func (o *CreateNicPayload) HasSecurityGroups() bool { - if o != nil && !IsNil(o.SecurityGroups) { - return true - } - - return false + _, ok := o.GetSecurityGroupsOk() + return ok } // SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. -func (o *CreateNicPayload) SetSecurityGroups(v *[]string) { - o.SecurityGroups = v +func (o *CreateNicPayload) SetSecurityGroups(v CreateNicPayloadGetSecurityGroupsRetType) { + setCreateNicPayloadGetSecurityGroupsAttributeType(&o.SecurityGroups, v) } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *CreateNicPayload) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - return o.Status +func (o *CreateNicPayload) GetStatus() (res CreateNicPayloadGetStatusRetType) { + 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 *CreateNicPayload) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true +func (o *CreateNicPayload) GetStatusOk() (ret CreateNicPayloadGetStatusRetType, ok bool) { + return getCreateNicPayloadGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. func (o *CreateNicPayload) 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 *CreateNicPayload) SetStatus(v *string) { - o.Status = v +func (o *CreateNicPayload) SetStatus(v CreateNicPayloadGetStatusRetType) { + setCreateNicPayloadGetStatusAttributeType(&o.Status, v) } // GetType returns the Type field value if set, zero value otherwise. -func (o *CreateNicPayload) GetType() *string { - if o == nil || IsNil(o.Type) { - var ret *string - return ret - } - return o.Type +func (o *CreateNicPayload) GetType() (res CreateNicPayloadGetTypeRetType) { + 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 *CreateNicPayload) GetTypeOk() (*string, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return o.Type, true +func (o *CreateNicPayload) GetTypeOk() (ret CreateNicPayloadGetTypeRetType, ok bool) { + return getCreateNicPayloadGetTypeAttributeTypeOk(o.Type) } // HasType returns a boolean if a field has been set. func (o *CreateNicPayload) HasType() bool { - if o != nil && !IsNil(o.Type) { - return true - } - - return false + _, ok := o.GetTypeOk() + return ok } // SetType gets a reference to the given string and assigns it to the Type field. -func (o *CreateNicPayload) SetType(v *string) { - o.Type = v +func (o *CreateNicPayload) SetType(v CreateNicPayloadGetTypeRetType) { + setCreateNicPayloadGetTypeAttributeType(&o.Type, v) } func (o CreateNicPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.AllowedAddresses) { - toSerialize["allowedAddresses"] = o.AllowedAddresses + if val, ok := getCreateNicPayloadGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses); ok { + toSerialize["AllowedAddresses"] = val } - if !IsNil(o.Device) { - toSerialize["device"] = o.Device + if val, ok := getCreateNicPayloadGetDeviceAttributeTypeOk(o.Device); ok { + toSerialize["Device"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getCreateNicPayloadGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Ipv4) { - toSerialize["ipv4"] = o.Ipv4 + if val, ok := getCreateNicPayloadGetIpv4AttributeTypeOk(o.Ipv4); ok { + toSerialize["Ipv4"] = val } - if !IsNil(o.Ipv6) { - toSerialize["ipv6"] = o.Ipv6 + if val, ok := getCreateNicPayloadGetIpv6AttributeTypeOk(o.Ipv6); ok { + toSerialize["Ipv6"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getCreateNicPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Mac) { - toSerialize["mac"] = o.Mac + if val, ok := getCreateNicPayloadGetMacAttributeTypeOk(o.Mac); ok { + toSerialize["Mac"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getCreateNicPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.NetworkId) { - toSerialize["networkId"] = o.NetworkId + if val, ok := getCreateNicPayloadGetNetworkIdAttributeTypeOk(o.NetworkId); ok { + toSerialize["NetworkId"] = val } - if !IsNil(o.NicSecurity) { - toSerialize["nicSecurity"] = o.NicSecurity + if val, ok := getCreateNicPayloadgetNicSecurityAttributeTypeOk(o.NicSecurity); ok { + toSerialize["NicSecurity"] = val } - if !IsNil(o.SecurityGroups) { - toSerialize["securityGroups"] = o.SecurityGroups + if val, ok := getCreateNicPayloadGetSecurityGroupsAttributeTypeOk(o.SecurityGroups); ok { + toSerialize["SecurityGroups"] = val } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status + if val, ok := getCreateNicPayloadGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } - if !IsNil(o.Type) { - toSerialize["type"] = o.Type + if val, ok := getCreateNicPayloadGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_public_ip_payload.go b/services/iaas/model_create_public_ip_payload.go index 132f20122..fab8e8b10 100644 --- a/services/iaas/model_create_public_ip_payload.go +++ b/services/iaas/model_create_public_ip_payload.go @@ -17,16 +17,103 @@ import ( // checks if the CreatePublicIPPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreatePublicIPPayload{} +/* + types and functions for id +*/ + +// isNotNullableString +type CreatePublicIPPayloadGetIdAttributeType = *string + +func getCreatePublicIPPayloadGetIdAttributeTypeOk(arg CreatePublicIPPayloadGetIdAttributeType) (ret CreatePublicIPPayloadGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreatePublicIPPayloadGetIdAttributeType(arg *CreatePublicIPPayloadGetIdAttributeType, val CreatePublicIPPayloadGetIdRetType) { + *arg = &val +} + +type CreatePublicIPPayloadGetIdArgType = string +type CreatePublicIPPayloadGetIdRetType = string + +/* + types and functions for ip +*/ + +// isNotNullableString +type CreatePublicIPPayloadGetIpAttributeType = *string + +func getCreatePublicIPPayloadGetIpAttributeTypeOk(arg CreatePublicIPPayloadGetIpAttributeType) (ret CreatePublicIPPayloadGetIpRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreatePublicIPPayloadGetIpAttributeType(arg *CreatePublicIPPayloadGetIpAttributeType, val CreatePublicIPPayloadGetIpRetType) { + *arg = &val +} + +type CreatePublicIPPayloadGetIpArgType = string +type CreatePublicIPPayloadGetIpRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type CreatePublicIPPayloadGetLabelsAttributeType = *map[string]interface{} +type CreatePublicIPPayloadGetLabelsArgType = map[string]interface{} +type CreatePublicIPPayloadGetLabelsRetType = map[string]interface{} + +func getCreatePublicIPPayloadGetLabelsAttributeTypeOk(arg CreatePublicIPPayloadGetLabelsAttributeType) (ret CreatePublicIPPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreatePublicIPPayloadGetLabelsAttributeType(arg *CreatePublicIPPayloadGetLabelsAttributeType, val CreatePublicIPPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for networkInterface +*/ + +// isNullableString +type CreatePublicIPPayloadGetNetworkInterfaceAttributeType = *NullableString + +func getCreatePublicIPPayloadGetNetworkInterfaceAttributeTypeOk(arg CreatePublicIPPayloadGetNetworkInterfaceAttributeType) (ret CreatePublicIPPayloadGetNetworkInterfaceRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setCreatePublicIPPayloadGetNetworkInterfaceAttributeType(arg *CreatePublicIPPayloadGetNetworkInterfaceAttributeType, val CreatePublicIPPayloadGetNetworkInterfaceRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type CreatePublicIPPayloadGetNetworkInterfaceArgType = *string +type CreatePublicIPPayloadGetNetworkInterfaceRetType = *string + // CreatePublicIPPayload Object that represents a public IP. type CreatePublicIPPayload struct { // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id CreatePublicIPPayloadGetIdAttributeType `json:"id,omitempty"` // Object that represents an IP address. - Ip *string `json:"ip,omitempty"` + Ip CreatePublicIPPayloadGetIpAttributeType `json:"ip,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels CreatePublicIPPayloadGetLabelsAttributeType `json:"labels,omitempty"` // Universally Unique Identifier (UUID). - NetworkInterface *NullableString `json:"networkInterface,omitempty"` + NetworkInterface CreatePublicIPPayloadGetNetworkInterfaceAttributeType `json:"networkInterface,omitempty"` } // NewCreatePublicIPPayload instantiates a new CreatePublicIPPayload object @@ -47,166 +134,121 @@ func NewCreatePublicIPPayloadWithDefaults() *CreatePublicIPPayload { } // GetId returns the Id field value if set, zero value otherwise. -func (o *CreatePublicIPPayload) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *CreatePublicIPPayload) GetId() (res CreatePublicIPPayloadGetIdRetType) { + 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 *CreatePublicIPPayload) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *CreatePublicIPPayload) GetIdOk() (ret CreatePublicIPPayloadGetIdRetType, ok bool) { + return getCreatePublicIPPayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *CreatePublicIPPayload) 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 *CreatePublicIPPayload) SetId(v *string) { - o.Id = v +func (o *CreatePublicIPPayload) SetId(v CreatePublicIPPayloadGetIdRetType) { + setCreatePublicIPPayloadGetIdAttributeType(&o.Id, v) } // GetIp returns the Ip field value if set, zero value otherwise. -func (o *CreatePublicIPPayload) GetIp() *string { - if o == nil || IsNil(o.Ip) { - var ret *string - return ret - } - return o.Ip +func (o *CreatePublicIPPayload) GetIp() (res CreatePublicIPPayloadGetIpRetType) { + res, _ = o.GetIpOk() + return } // GetIpOk returns a tuple with the Ip field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreatePublicIPPayload) GetIpOk() (*string, bool) { - if o == nil || IsNil(o.Ip) { - return nil, false - } - return o.Ip, true +func (o *CreatePublicIPPayload) GetIpOk() (ret CreatePublicIPPayloadGetIpRetType, ok bool) { + return getCreatePublicIPPayloadGetIpAttributeTypeOk(o.Ip) } // HasIp returns a boolean if a field has been set. func (o *CreatePublicIPPayload) HasIp() bool { - if o != nil && !IsNil(o.Ip) { - return true - } - - return false + _, ok := o.GetIpOk() + return ok } // SetIp gets a reference to the given string and assigns it to the Ip field. -func (o *CreatePublicIPPayload) SetIp(v *string) { - o.Ip = v +func (o *CreatePublicIPPayload) SetIp(v CreatePublicIPPayloadGetIpRetType) { + setCreatePublicIPPayloadGetIpAttributeType(&o.Ip, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreatePublicIPPayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *CreatePublicIPPayload) GetLabels() (res CreatePublicIPPayloadGetLabelsRetType) { + 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 *CreatePublicIPPayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *CreatePublicIPPayload) GetLabelsOk() (ret CreatePublicIPPayloadGetLabelsRetType, ok bool) { + return getCreatePublicIPPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *CreatePublicIPPayload) 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 *CreatePublicIPPayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *CreatePublicIPPayload) SetLabels(v CreatePublicIPPayloadGetLabelsRetType) { + setCreatePublicIPPayloadGetLabelsAttributeType(&o.Labels, v) } // GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CreatePublicIPPayload) GetNetworkInterface() *string { - if o == nil || IsNil(o.NetworkInterface) || IsNil(o.NetworkInterface.Get()) { - var ret *string - return ret - } - return o.NetworkInterface.Get() +func (o *CreatePublicIPPayload) GetNetworkInterface() (res CreatePublicIPPayloadGetNetworkInterfaceRetType) { + res, _ = o.GetNetworkInterfaceOk() + return } // GetNetworkInterfaceOk returns a tuple with the NetworkInterface field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreatePublicIPPayload) GetNetworkInterfaceOk() (*string, bool) { - if o == nil || IsNil(o.NetworkInterface) { - return nil, false - } - return o.NetworkInterface.Get(), o.NetworkInterface.IsSet() +func (o *CreatePublicIPPayload) GetNetworkInterfaceOk() (ret CreatePublicIPPayloadGetNetworkInterfaceRetType, ok bool) { + return getCreatePublicIPPayloadGetNetworkInterfaceAttributeTypeOk(o.NetworkInterface) } // HasNetworkInterface returns a boolean if a field has been set. func (o *CreatePublicIPPayload) HasNetworkInterface() bool { - if o != nil && !IsNil(o.NetworkInterface) && o.NetworkInterface.IsSet() { - return true - } - - return false + _, ok := o.GetNetworkInterfaceOk() + return ok } // SetNetworkInterface gets a reference to the given string and assigns it to the NetworkInterface field. -func (o *CreatePublicIPPayload) SetNetworkInterface(v *string) { - if IsNil(o.NetworkInterface) { - o.NetworkInterface = new(NullableString) - } - o.NetworkInterface.Set(v) +func (o *CreatePublicIPPayload) SetNetworkInterface(v CreatePublicIPPayloadGetNetworkInterfaceRetType) { + setCreatePublicIPPayloadGetNetworkInterfaceAttributeType(&o.NetworkInterface, v) } // SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil func (o *CreatePublicIPPayload) SetNetworkInterfaceNil() { - if IsNil(o.NetworkInterface) { - o.NetworkInterface = new(NullableString) - } - o.NetworkInterface.Set(nil) + o.NetworkInterface = nil } // UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil func (o *CreatePublicIPPayload) UnsetNetworkInterface() { - if IsNil(o.NetworkInterface) { - o.NetworkInterface = new(NullableString) - } - o.NetworkInterface.Unset() + o.NetworkInterface = nil } func (o CreatePublicIPPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getCreatePublicIPPayloadGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Ip) { - toSerialize["ip"] = o.Ip + if val, ok := getCreatePublicIPPayloadGetIpAttributeTypeOk(o.Ip); ok { + toSerialize["Ip"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getCreatePublicIPPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if o.NetworkInterface.IsSet() { - toSerialize["networkInterface"] = o.NetworkInterface.Get() + if val, ok := getCreatePublicIPPayloadGetNetworkInterfaceAttributeTypeOk(o.NetworkInterface); ok { + toSerialize["NetworkInterface"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_security_group_payload.go b/services/iaas/model_create_security_group_payload.go index ff3ffb293..b64e02ae5 100644 --- a/services/iaas/model_create_security_group_payload.go +++ b/services/iaas/model_create_security_group_payload.go @@ -18,25 +18,188 @@ import ( // checks if the CreateSecurityGroupPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateSecurityGroupPayload{} +/* + types and functions for createdAt +*/ + +// isDateTime +type CreateSecurityGroupPayloadGetCreatedAtAttributeType = *time.Time +type CreateSecurityGroupPayloadGetCreatedAtArgType = time.Time +type CreateSecurityGroupPayloadGetCreatedAtRetType = time.Time + +func getCreateSecurityGroupPayloadGetCreatedAtAttributeTypeOk(arg CreateSecurityGroupPayloadGetCreatedAtAttributeType) (ret CreateSecurityGroupPayloadGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSecurityGroupPayloadGetCreatedAtAttributeType(arg *CreateSecurityGroupPayloadGetCreatedAtAttributeType, val CreateSecurityGroupPayloadGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for description +*/ + +// isNotNullableString +type CreateSecurityGroupPayloadGetDescriptionAttributeType = *string + +func getCreateSecurityGroupPayloadGetDescriptionAttributeTypeOk(arg CreateSecurityGroupPayloadGetDescriptionAttributeType) (ret CreateSecurityGroupPayloadGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSecurityGroupPayloadGetDescriptionAttributeType(arg *CreateSecurityGroupPayloadGetDescriptionAttributeType, val CreateSecurityGroupPayloadGetDescriptionRetType) { + *arg = &val +} + +type CreateSecurityGroupPayloadGetDescriptionArgType = string +type CreateSecurityGroupPayloadGetDescriptionRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type CreateSecurityGroupPayloadGetIdAttributeType = *string + +func getCreateSecurityGroupPayloadGetIdAttributeTypeOk(arg CreateSecurityGroupPayloadGetIdAttributeType) (ret CreateSecurityGroupPayloadGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSecurityGroupPayloadGetIdAttributeType(arg *CreateSecurityGroupPayloadGetIdAttributeType, val CreateSecurityGroupPayloadGetIdRetType) { + *arg = &val +} + +type CreateSecurityGroupPayloadGetIdArgType = string +type CreateSecurityGroupPayloadGetIdRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type CreateSecurityGroupPayloadGetLabelsAttributeType = *map[string]interface{} +type CreateSecurityGroupPayloadGetLabelsArgType = map[string]interface{} +type CreateSecurityGroupPayloadGetLabelsRetType = map[string]interface{} + +func getCreateSecurityGroupPayloadGetLabelsAttributeTypeOk(arg CreateSecurityGroupPayloadGetLabelsAttributeType) (ret CreateSecurityGroupPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSecurityGroupPayloadGetLabelsAttributeType(arg *CreateSecurityGroupPayloadGetLabelsAttributeType, val CreateSecurityGroupPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateSecurityGroupPayloadGetNameAttributeType = *string + +func getCreateSecurityGroupPayloadGetNameAttributeTypeOk(arg CreateSecurityGroupPayloadGetNameAttributeType) (ret CreateSecurityGroupPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSecurityGroupPayloadGetNameAttributeType(arg *CreateSecurityGroupPayloadGetNameAttributeType, val CreateSecurityGroupPayloadGetNameRetType) { + *arg = &val +} + +type CreateSecurityGroupPayloadGetNameArgType = string +type CreateSecurityGroupPayloadGetNameRetType = string + +/* + types and functions for rules +*/ + +// isArray +type CreateSecurityGroupPayloadGetRulesAttributeType = *[]SecurityGroupRule +type CreateSecurityGroupPayloadGetRulesArgType = []SecurityGroupRule +type CreateSecurityGroupPayloadGetRulesRetType = []SecurityGroupRule + +func getCreateSecurityGroupPayloadGetRulesAttributeTypeOk(arg CreateSecurityGroupPayloadGetRulesAttributeType) (ret CreateSecurityGroupPayloadGetRulesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSecurityGroupPayloadGetRulesAttributeType(arg *CreateSecurityGroupPayloadGetRulesAttributeType, val CreateSecurityGroupPayloadGetRulesRetType) { + *arg = &val +} + +/* + types and functions for stateful +*/ + +// isBoolean +type CreateSecurityGroupPayloadgetStatefulAttributeType = *bool +type CreateSecurityGroupPayloadgetStatefulArgType = bool +type CreateSecurityGroupPayloadgetStatefulRetType = bool + +func getCreateSecurityGroupPayloadgetStatefulAttributeTypeOk(arg CreateSecurityGroupPayloadgetStatefulAttributeType) (ret CreateSecurityGroupPayloadgetStatefulRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSecurityGroupPayloadgetStatefulAttributeType(arg *CreateSecurityGroupPayloadgetStatefulAttributeType, val CreateSecurityGroupPayloadgetStatefulRetType) { + *arg = &val +} + +/* + types and functions for updatedAt +*/ + +// isDateTime +type CreateSecurityGroupPayloadGetUpdatedAtAttributeType = *time.Time +type CreateSecurityGroupPayloadGetUpdatedAtArgType = time.Time +type CreateSecurityGroupPayloadGetUpdatedAtRetType = time.Time + +func getCreateSecurityGroupPayloadGetUpdatedAtAttributeTypeOk(arg CreateSecurityGroupPayloadGetUpdatedAtAttributeType) (ret CreateSecurityGroupPayloadGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSecurityGroupPayloadGetUpdatedAtAttributeType(arg *CreateSecurityGroupPayloadGetUpdatedAtAttributeType, val CreateSecurityGroupPayloadGetUpdatedAtRetType) { + *arg = &val +} + // CreateSecurityGroupPayload Object that represents a security group. type CreateSecurityGroupPayload struct { // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt CreateSecurityGroupPayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Description Object. Allows string up to 127 Characters. - Description *string `json:"description,omitempty"` + Description CreateSecurityGroupPayloadGetDescriptionAttributeType `json:"description,omitempty"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id CreateSecurityGroupPayloadGetIdAttributeType `json:"id,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels CreateSecurityGroupPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED - Name *string `json:"name"` + Name CreateSecurityGroupPayloadGetNameAttributeType `json:"name"` // A list containing security group rule objects. - Rules *[]SecurityGroupRule `json:"rules,omitempty"` + Rules CreateSecurityGroupPayloadGetRulesAttributeType `json:"rules,omitempty"` // Shows if a security group is stateful or stateless. You can only have one type of security groups per network interface/server. - Stateful *bool `json:"stateful,omitempty"` + Stateful CreateSecurityGroupPayloadgetStatefulAttributeType `json:"stateful,omitempty"` // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAt CreateSecurityGroupPayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } type _CreateSecurityGroupPayload CreateSecurityGroupPayload @@ -45,11 +208,9 @@ type _CreateSecurityGroupPayload CreateSecurityGroupPayload // 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 NewCreateSecurityGroupPayload(name *string) *CreateSecurityGroupPayload { +func NewCreateSecurityGroupPayload(name CreateSecurityGroupPayloadGetNameArgType) *CreateSecurityGroupPayload { this := CreateSecurityGroupPayload{} - this.Name = name - var stateful bool = true - this.Stateful = &stateful + setCreateSecurityGroupPayloadGetNameAttributeType(&this.Name, name) return &this } @@ -64,276 +225,208 @@ func NewCreateSecurityGroupPayloadWithDefaults() *CreateSecurityGroupPayload { } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *CreateSecurityGroupPayload) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - return o.CreatedAt +func (o *CreateSecurityGroupPayload) GetCreatedAt() (res CreateSecurityGroupPayloadGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return } // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateSecurityGroupPayload) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true +func (o *CreateSecurityGroupPayload) GetCreatedAtOk() (ret CreateSecurityGroupPayloadGetCreatedAtRetType, ok bool) { + return getCreateSecurityGroupPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. func (o *CreateSecurityGroupPayload) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false + _, ok := o.GetCreatedAtOk() + return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *CreateSecurityGroupPayload) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *CreateSecurityGroupPayload) SetCreatedAt(v CreateSecurityGroupPayloadGetCreatedAtRetType) { + setCreateSecurityGroupPayloadGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *CreateSecurityGroupPayload) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *CreateSecurityGroupPayload) GetDescription() (res CreateSecurityGroupPayloadGetDescriptionRetType) { + 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 *CreateSecurityGroupPayload) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *CreateSecurityGroupPayload) GetDescriptionOk() (ret CreateSecurityGroupPayloadGetDescriptionRetType, ok bool) { + return getCreateSecurityGroupPayloadGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *CreateSecurityGroupPayload) 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 *CreateSecurityGroupPayload) SetDescription(v *string) { - o.Description = v +func (o *CreateSecurityGroupPayload) SetDescription(v CreateSecurityGroupPayloadGetDescriptionRetType) { + setCreateSecurityGroupPayloadGetDescriptionAttributeType(&o.Description, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *CreateSecurityGroupPayload) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *CreateSecurityGroupPayload) GetId() (res CreateSecurityGroupPayloadGetIdRetType) { + 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 *CreateSecurityGroupPayload) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *CreateSecurityGroupPayload) GetIdOk() (ret CreateSecurityGroupPayloadGetIdRetType, ok bool) { + return getCreateSecurityGroupPayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *CreateSecurityGroupPayload) 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 *CreateSecurityGroupPayload) SetId(v *string) { - o.Id = v +func (o *CreateSecurityGroupPayload) SetId(v CreateSecurityGroupPayloadGetIdRetType) { + setCreateSecurityGroupPayloadGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateSecurityGroupPayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *CreateSecurityGroupPayload) GetLabels() (res CreateSecurityGroupPayloadGetLabelsRetType) { + 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 *CreateSecurityGroupPayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *CreateSecurityGroupPayload) GetLabelsOk() (ret CreateSecurityGroupPayloadGetLabelsRetType, ok bool) { + return getCreateSecurityGroupPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *CreateSecurityGroupPayload) 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 *CreateSecurityGroupPayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *CreateSecurityGroupPayload) SetLabels(v CreateSecurityGroupPayloadGetLabelsRetType) { + setCreateSecurityGroupPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value -func (o *CreateSecurityGroupPayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *CreateSecurityGroupPayload) GetName() (ret CreateSecurityGroupPayloadGetNameRetType) { + 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 *CreateSecurityGroupPayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *CreateSecurityGroupPayload) GetNameOk() (ret CreateSecurityGroupPayloadGetNameRetType, ok bool) { + return getCreateSecurityGroupPayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *CreateSecurityGroupPayload) SetName(v *string) { - o.Name = v +func (o *CreateSecurityGroupPayload) SetName(v CreateSecurityGroupPayloadGetNameRetType) { + setCreateSecurityGroupPayloadGetNameAttributeType(&o.Name, v) } // GetRules returns the Rules field value if set, zero value otherwise. -func (o *CreateSecurityGroupPayload) GetRules() *[]SecurityGroupRule { - if o == nil || IsNil(o.Rules) { - var ret *[]SecurityGroupRule - return ret - } - return o.Rules +func (o *CreateSecurityGroupPayload) GetRules() (res CreateSecurityGroupPayloadGetRulesRetType) { + res, _ = o.GetRulesOk() + return } // GetRulesOk returns a tuple with the Rules field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateSecurityGroupPayload) GetRulesOk() (*[]SecurityGroupRule, bool) { - if o == nil || IsNil(o.Rules) { - return nil, false - } - return o.Rules, true +func (o *CreateSecurityGroupPayload) GetRulesOk() (ret CreateSecurityGroupPayloadGetRulesRetType, ok bool) { + return getCreateSecurityGroupPayloadGetRulesAttributeTypeOk(o.Rules) } // HasRules returns a boolean if a field has been set. func (o *CreateSecurityGroupPayload) HasRules() bool { - if o != nil && !IsNil(o.Rules) { - return true - } - - return false + _, ok := o.GetRulesOk() + return ok } // SetRules gets a reference to the given []SecurityGroupRule and assigns it to the Rules field. -func (o *CreateSecurityGroupPayload) SetRules(v *[]SecurityGroupRule) { - o.Rules = v +func (o *CreateSecurityGroupPayload) SetRules(v CreateSecurityGroupPayloadGetRulesRetType) { + setCreateSecurityGroupPayloadGetRulesAttributeType(&o.Rules, v) } // GetStateful returns the Stateful field value if set, zero value otherwise. -func (o *CreateSecurityGroupPayload) GetStateful() *bool { - if o == nil || IsNil(o.Stateful) { - var ret *bool - return ret - } - return o.Stateful +func (o *CreateSecurityGroupPayload) GetStateful() (res CreateSecurityGroupPayloadgetStatefulRetType) { + res, _ = o.GetStatefulOk() + return } // GetStatefulOk returns a tuple with the Stateful field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateSecurityGroupPayload) GetStatefulOk() (*bool, bool) { - if o == nil || IsNil(o.Stateful) { - return nil, false - } - return o.Stateful, true +func (o *CreateSecurityGroupPayload) GetStatefulOk() (ret CreateSecurityGroupPayloadgetStatefulRetType, ok bool) { + return getCreateSecurityGroupPayloadgetStatefulAttributeTypeOk(o.Stateful) } // HasStateful returns a boolean if a field has been set. func (o *CreateSecurityGroupPayload) HasStateful() bool { - if o != nil && !IsNil(o.Stateful) { - return true - } - - return false + _, ok := o.GetStatefulOk() + return ok } // SetStateful gets a reference to the given bool and assigns it to the Stateful field. -func (o *CreateSecurityGroupPayload) SetStateful(v *bool) { - o.Stateful = v +func (o *CreateSecurityGroupPayload) SetStateful(v CreateSecurityGroupPayloadgetStatefulRetType) { + setCreateSecurityGroupPayloadgetStatefulAttributeType(&o.Stateful, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *CreateSecurityGroupPayload) GetUpdatedAt() *time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret *time.Time - return ret - } - return o.UpdatedAt +func (o *CreateSecurityGroupPayload) GetUpdatedAt() (res CreateSecurityGroupPayloadGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateSecurityGroupPayload) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true +func (o *CreateSecurityGroupPayload) GetUpdatedAtOk() (ret CreateSecurityGroupPayloadGetUpdatedAtRetType, ok bool) { + return getCreateSecurityGroupPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. func (o *CreateSecurityGroupPayload) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false + _, ok := o.GetUpdatedAtOk() + return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *CreateSecurityGroupPayload) SetUpdatedAt(v *time.Time) { - o.UpdatedAt = v +func (o *CreateSecurityGroupPayload) SetUpdatedAt(v CreateSecurityGroupPayloadGetUpdatedAtRetType) { + setCreateSecurityGroupPayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) } func (o CreateSecurityGroupPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt + if val, ok := getCreateSecurityGroupPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getCreateSecurityGroupPayloadGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getCreateSecurityGroupPayloadGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getCreateSecurityGroupPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getCreateSecurityGroupPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - toSerialize["name"] = o.Name - if !IsNil(o.Rules) { - toSerialize["rules"] = o.Rules + if val, ok := getCreateSecurityGroupPayloadGetRulesAttributeTypeOk(o.Rules); ok { + toSerialize["Rules"] = val } - if !IsNil(o.Stateful) { - toSerialize["stateful"] = o.Stateful + if val, ok := getCreateSecurityGroupPayloadgetStatefulAttributeTypeOk(o.Stateful); ok { + toSerialize["Stateful"] = val } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt + if val, ok := getCreateSecurityGroupPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_security_group_rule_payload.go b/services/iaas/model_create_security_group_rule_payload.go index a9ef31b46..060864813 100644 --- a/services/iaas/model_create_security_group_rule_payload.go +++ b/services/iaas/model_create_security_group_rule_payload.go @@ -17,26 +17,233 @@ import ( // checks if the CreateSecurityGroupRulePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateSecurityGroupRulePayload{} +/* + types and functions for description +*/ + +// isNotNullableString +type CreateSecurityGroupRulePayloadGetDescriptionAttributeType = *string + +func getCreateSecurityGroupRulePayloadGetDescriptionAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetDescriptionAttributeType) (ret CreateSecurityGroupRulePayloadGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSecurityGroupRulePayloadGetDescriptionAttributeType(arg *CreateSecurityGroupRulePayloadGetDescriptionAttributeType, val CreateSecurityGroupRulePayloadGetDescriptionRetType) { + *arg = &val +} + +type CreateSecurityGroupRulePayloadGetDescriptionArgType = string +type CreateSecurityGroupRulePayloadGetDescriptionRetType = string + +/* + types and functions for direction +*/ + +// isNotNullableString +type CreateSecurityGroupRulePayloadGetDirectionAttributeType = *string + +func getCreateSecurityGroupRulePayloadGetDirectionAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetDirectionAttributeType) (ret CreateSecurityGroupRulePayloadGetDirectionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSecurityGroupRulePayloadGetDirectionAttributeType(arg *CreateSecurityGroupRulePayloadGetDirectionAttributeType, val CreateSecurityGroupRulePayloadGetDirectionRetType) { + *arg = &val +} + +type CreateSecurityGroupRulePayloadGetDirectionArgType = string +type CreateSecurityGroupRulePayloadGetDirectionRetType = string + +/* + types and functions for ethertype +*/ + +// isNotNullableString +type CreateSecurityGroupRulePayloadGetEthertypeAttributeType = *string + +func getCreateSecurityGroupRulePayloadGetEthertypeAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetEthertypeAttributeType) (ret CreateSecurityGroupRulePayloadGetEthertypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSecurityGroupRulePayloadGetEthertypeAttributeType(arg *CreateSecurityGroupRulePayloadGetEthertypeAttributeType, val CreateSecurityGroupRulePayloadGetEthertypeRetType) { + *arg = &val +} + +type CreateSecurityGroupRulePayloadGetEthertypeArgType = string +type CreateSecurityGroupRulePayloadGetEthertypeRetType = string + +/* + types and functions for icmpParameters +*/ + +// isModel +type CreateSecurityGroupRulePayloadGetIcmpParametersAttributeType = *ICMPParameters +type CreateSecurityGroupRulePayloadGetIcmpParametersArgType = ICMPParameters +type CreateSecurityGroupRulePayloadGetIcmpParametersRetType = ICMPParameters + +func getCreateSecurityGroupRulePayloadGetIcmpParametersAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetIcmpParametersAttributeType) (ret CreateSecurityGroupRulePayloadGetIcmpParametersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSecurityGroupRulePayloadGetIcmpParametersAttributeType(arg *CreateSecurityGroupRulePayloadGetIcmpParametersAttributeType, val CreateSecurityGroupRulePayloadGetIcmpParametersRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type CreateSecurityGroupRulePayloadGetIdAttributeType = *string + +func getCreateSecurityGroupRulePayloadGetIdAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetIdAttributeType) (ret CreateSecurityGroupRulePayloadGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSecurityGroupRulePayloadGetIdAttributeType(arg *CreateSecurityGroupRulePayloadGetIdAttributeType, val CreateSecurityGroupRulePayloadGetIdRetType) { + *arg = &val +} + +type CreateSecurityGroupRulePayloadGetIdArgType = string +type CreateSecurityGroupRulePayloadGetIdRetType = string + +/* + types and functions for ipRange +*/ + +// isNotNullableString +type CreateSecurityGroupRulePayloadGetIpRangeAttributeType = *string + +func getCreateSecurityGroupRulePayloadGetIpRangeAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetIpRangeAttributeType) (ret CreateSecurityGroupRulePayloadGetIpRangeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSecurityGroupRulePayloadGetIpRangeAttributeType(arg *CreateSecurityGroupRulePayloadGetIpRangeAttributeType, val CreateSecurityGroupRulePayloadGetIpRangeRetType) { + *arg = &val +} + +type CreateSecurityGroupRulePayloadGetIpRangeArgType = string +type CreateSecurityGroupRulePayloadGetIpRangeRetType = string + +/* + types and functions for portRange +*/ + +// isModel +type CreateSecurityGroupRulePayloadGetPortRangeAttributeType = *PortRange +type CreateSecurityGroupRulePayloadGetPortRangeArgType = PortRange +type CreateSecurityGroupRulePayloadGetPortRangeRetType = PortRange + +func getCreateSecurityGroupRulePayloadGetPortRangeAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetPortRangeAttributeType) (ret CreateSecurityGroupRulePayloadGetPortRangeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSecurityGroupRulePayloadGetPortRangeAttributeType(arg *CreateSecurityGroupRulePayloadGetPortRangeAttributeType, val CreateSecurityGroupRulePayloadGetPortRangeRetType) { + *arg = &val +} + +/* + types and functions for remoteSecurityGroupId +*/ + +// isNotNullableString +type CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeType = *string + +func getCreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeType) (ret CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeType(arg *CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeType, val CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdRetType) { + *arg = &val +} + +type CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdArgType = string +type CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdRetType = string + +/* + types and functions for securityGroupId +*/ + +// isNotNullableString +type CreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeType = *string + +func getCreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeType) (ret CreateSecurityGroupRulePayloadGetSecurityGroupIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeType(arg *CreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeType, val CreateSecurityGroupRulePayloadGetSecurityGroupIdRetType) { + *arg = &val +} + +type CreateSecurityGroupRulePayloadGetSecurityGroupIdArgType = string +type CreateSecurityGroupRulePayloadGetSecurityGroupIdRetType = string + +/* + types and functions for protocol +*/ + +// isModel +type CreateSecurityGroupRulePayloadGetProtocolAttributeType = *CreateProtocol +type CreateSecurityGroupRulePayloadGetProtocolArgType = CreateProtocol +type CreateSecurityGroupRulePayloadGetProtocolRetType = CreateProtocol + +func getCreateSecurityGroupRulePayloadGetProtocolAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetProtocolAttributeType) (ret CreateSecurityGroupRulePayloadGetProtocolRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSecurityGroupRulePayloadGetProtocolAttributeType(arg *CreateSecurityGroupRulePayloadGetProtocolAttributeType, val CreateSecurityGroupRulePayloadGetProtocolRetType) { + *arg = &val +} + // CreateSecurityGroupRulePayload Object that represents a request body for security group rule creation. type CreateSecurityGroupRulePayload struct { // Description Object. Allows string up to 127 Characters. - Description *string `json:"description,omitempty"` + Description CreateSecurityGroupRulePayloadGetDescriptionAttributeType `json:"description,omitempty"` // The direction of the traffic which the rule should match. // REQUIRED - Direction *string `json:"direction"` + Direction CreateSecurityGroupRulePayloadGetDirectionAttributeType `json:"direction"` // The ethertype which the rule should match. - Ethertype *string `json:"ethertype,omitempty"` - IcmpParameters *ICMPParameters `json:"icmpParameters,omitempty"` + Ethertype CreateSecurityGroupRulePayloadGetEthertypeAttributeType `json:"ethertype,omitempty"` + IcmpParameters CreateSecurityGroupRulePayloadGetIcmpParametersAttributeType `json:"icmpParameters,omitempty"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id CreateSecurityGroupRulePayloadGetIdAttributeType `json:"id,omitempty"` // Classless Inter-Domain Routing (CIDR). - IpRange *string `json:"ipRange,omitempty"` - PortRange *PortRange `json:"portRange,omitempty"` + IpRange CreateSecurityGroupRulePayloadGetIpRangeAttributeType `json:"ipRange,omitempty"` + PortRange CreateSecurityGroupRulePayloadGetPortRangeAttributeType `json:"portRange,omitempty"` // Universally Unique Identifier (UUID). - RemoteSecurityGroupId *string `json:"remoteSecurityGroupId,omitempty"` + RemoteSecurityGroupId CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeType `json:"remoteSecurityGroupId,omitempty"` // Universally Unique Identifier (UUID). - SecurityGroupId *string `json:"securityGroupId,omitempty"` - Protocol *CreateProtocol `json:"protocol,omitempty"` + SecurityGroupId CreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeType `json:"securityGroupId,omitempty"` + Protocol CreateSecurityGroupRulePayloadGetProtocolAttributeType `json:"protocol,omitempty"` } type _CreateSecurityGroupRulePayload CreateSecurityGroupRulePayload @@ -45,11 +252,9 @@ type _CreateSecurityGroupRulePayload CreateSecurityGroupRulePayload // 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 NewCreateSecurityGroupRulePayload(direction *string) *CreateSecurityGroupRulePayload { +func NewCreateSecurityGroupRulePayload(direction CreateSecurityGroupRulePayloadGetDirectionArgType) *CreateSecurityGroupRulePayload { this := CreateSecurityGroupRulePayload{} - this.Direction = direction - var ethertype string = "IPv4" - this.Ethertype = ðertype + setCreateSecurityGroupRulePayloadGetDirectionAttributeType(&this.Direction, direction) return &this } @@ -64,346 +269,260 @@ func NewCreateSecurityGroupRulePayloadWithDefaults() *CreateSecurityGroupRulePay } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *CreateSecurityGroupRulePayload) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *CreateSecurityGroupRulePayload) GetDescription() (res CreateSecurityGroupRulePayloadGetDescriptionRetType) { + 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 *CreateSecurityGroupRulePayload) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *CreateSecurityGroupRulePayload) GetDescriptionOk() (ret CreateSecurityGroupRulePayloadGetDescriptionRetType, ok bool) { + return getCreateSecurityGroupRulePayloadGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *CreateSecurityGroupRulePayload) 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 *CreateSecurityGroupRulePayload) SetDescription(v *string) { - o.Description = v +func (o *CreateSecurityGroupRulePayload) SetDescription(v CreateSecurityGroupRulePayloadGetDescriptionRetType) { + setCreateSecurityGroupRulePayloadGetDescriptionAttributeType(&o.Description, v) } // GetDirection returns the Direction field value -func (o *CreateSecurityGroupRulePayload) GetDirection() *string { - if o == nil || IsNil(o.Direction) { - var ret *string - return ret - } - - return o.Direction +func (o *CreateSecurityGroupRulePayload) GetDirection() (ret CreateSecurityGroupRulePayloadGetDirectionRetType) { + ret, _ = o.GetDirectionOk() + return ret } // GetDirectionOk returns a tuple with the Direction field value // and a boolean to check if the value has been set. -func (o *CreateSecurityGroupRulePayload) GetDirectionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Direction, true +func (o *CreateSecurityGroupRulePayload) GetDirectionOk() (ret CreateSecurityGroupRulePayloadGetDirectionRetType, ok bool) { + return getCreateSecurityGroupRulePayloadGetDirectionAttributeTypeOk(o.Direction) } // SetDirection sets field value -func (o *CreateSecurityGroupRulePayload) SetDirection(v *string) { - o.Direction = v +func (o *CreateSecurityGroupRulePayload) SetDirection(v CreateSecurityGroupRulePayloadGetDirectionRetType) { + setCreateSecurityGroupRulePayloadGetDirectionAttributeType(&o.Direction, v) } // GetEthertype returns the Ethertype field value if set, zero value otherwise. -func (o *CreateSecurityGroupRulePayload) GetEthertype() *string { - if o == nil || IsNil(o.Ethertype) { - var ret *string - return ret - } - return o.Ethertype +func (o *CreateSecurityGroupRulePayload) GetEthertype() (res CreateSecurityGroupRulePayloadGetEthertypeRetType) { + res, _ = o.GetEthertypeOk() + return } // GetEthertypeOk returns a tuple with the Ethertype field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateSecurityGroupRulePayload) GetEthertypeOk() (*string, bool) { - if o == nil || IsNil(o.Ethertype) { - return nil, false - } - return o.Ethertype, true +func (o *CreateSecurityGroupRulePayload) GetEthertypeOk() (ret CreateSecurityGroupRulePayloadGetEthertypeRetType, ok bool) { + return getCreateSecurityGroupRulePayloadGetEthertypeAttributeTypeOk(o.Ethertype) } // HasEthertype returns a boolean if a field has been set. func (o *CreateSecurityGroupRulePayload) HasEthertype() bool { - if o != nil && !IsNil(o.Ethertype) { - return true - } - - return false + _, ok := o.GetEthertypeOk() + return ok } // SetEthertype gets a reference to the given string and assigns it to the Ethertype field. -func (o *CreateSecurityGroupRulePayload) SetEthertype(v *string) { - o.Ethertype = v +func (o *CreateSecurityGroupRulePayload) SetEthertype(v CreateSecurityGroupRulePayloadGetEthertypeRetType) { + setCreateSecurityGroupRulePayloadGetEthertypeAttributeType(&o.Ethertype, v) } // GetIcmpParameters returns the IcmpParameters field value if set, zero value otherwise. -func (o *CreateSecurityGroupRulePayload) GetIcmpParameters() *ICMPParameters { - if o == nil || IsNil(o.IcmpParameters) { - var ret *ICMPParameters - return ret - } - return o.IcmpParameters +func (o *CreateSecurityGroupRulePayload) GetIcmpParameters() (res CreateSecurityGroupRulePayloadGetIcmpParametersRetType) { + res, _ = o.GetIcmpParametersOk() + return } // GetIcmpParametersOk returns a tuple with the IcmpParameters field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateSecurityGroupRulePayload) GetIcmpParametersOk() (*ICMPParameters, bool) { - if o == nil || IsNil(o.IcmpParameters) { - return nil, false - } - return o.IcmpParameters, true +func (o *CreateSecurityGroupRulePayload) GetIcmpParametersOk() (ret CreateSecurityGroupRulePayloadGetIcmpParametersRetType, ok bool) { + return getCreateSecurityGroupRulePayloadGetIcmpParametersAttributeTypeOk(o.IcmpParameters) } // HasIcmpParameters returns a boolean if a field has been set. func (o *CreateSecurityGroupRulePayload) HasIcmpParameters() bool { - if o != nil && !IsNil(o.IcmpParameters) { - return true - } - - return false + _, ok := o.GetIcmpParametersOk() + return ok } // SetIcmpParameters gets a reference to the given ICMPParameters and assigns it to the IcmpParameters field. -func (o *CreateSecurityGroupRulePayload) SetIcmpParameters(v *ICMPParameters) { - o.IcmpParameters = v +func (o *CreateSecurityGroupRulePayload) SetIcmpParameters(v CreateSecurityGroupRulePayloadGetIcmpParametersRetType) { + setCreateSecurityGroupRulePayloadGetIcmpParametersAttributeType(&o.IcmpParameters, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *CreateSecurityGroupRulePayload) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *CreateSecurityGroupRulePayload) GetId() (res CreateSecurityGroupRulePayloadGetIdRetType) { + 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 *CreateSecurityGroupRulePayload) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *CreateSecurityGroupRulePayload) GetIdOk() (ret CreateSecurityGroupRulePayloadGetIdRetType, ok bool) { + return getCreateSecurityGroupRulePayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *CreateSecurityGroupRulePayload) 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 *CreateSecurityGroupRulePayload) SetId(v *string) { - o.Id = v +func (o *CreateSecurityGroupRulePayload) SetId(v CreateSecurityGroupRulePayloadGetIdRetType) { + setCreateSecurityGroupRulePayloadGetIdAttributeType(&o.Id, v) } // GetIpRange returns the IpRange field value if set, zero value otherwise. -func (o *CreateSecurityGroupRulePayload) GetIpRange() *string { - if o == nil || IsNil(o.IpRange) { - var ret *string - return ret - } - return o.IpRange +func (o *CreateSecurityGroupRulePayload) GetIpRange() (res CreateSecurityGroupRulePayloadGetIpRangeRetType) { + res, _ = o.GetIpRangeOk() + return } // GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateSecurityGroupRulePayload) GetIpRangeOk() (*string, bool) { - if o == nil || IsNil(o.IpRange) { - return nil, false - } - return o.IpRange, true +func (o *CreateSecurityGroupRulePayload) GetIpRangeOk() (ret CreateSecurityGroupRulePayloadGetIpRangeRetType, ok bool) { + return getCreateSecurityGroupRulePayloadGetIpRangeAttributeTypeOk(o.IpRange) } // HasIpRange returns a boolean if a field has been set. func (o *CreateSecurityGroupRulePayload) HasIpRange() bool { - if o != nil && !IsNil(o.IpRange) { - return true - } - - return false + _, ok := o.GetIpRangeOk() + return ok } // SetIpRange gets a reference to the given string and assigns it to the IpRange field. -func (o *CreateSecurityGroupRulePayload) SetIpRange(v *string) { - o.IpRange = v +func (o *CreateSecurityGroupRulePayload) SetIpRange(v CreateSecurityGroupRulePayloadGetIpRangeRetType) { + setCreateSecurityGroupRulePayloadGetIpRangeAttributeType(&o.IpRange, v) } // GetPortRange returns the PortRange field value if set, zero value otherwise. -func (o *CreateSecurityGroupRulePayload) GetPortRange() *PortRange { - if o == nil || IsNil(o.PortRange) { - var ret *PortRange - return ret - } - return o.PortRange +func (o *CreateSecurityGroupRulePayload) GetPortRange() (res CreateSecurityGroupRulePayloadGetPortRangeRetType) { + res, _ = o.GetPortRangeOk() + return } // GetPortRangeOk returns a tuple with the PortRange field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateSecurityGroupRulePayload) GetPortRangeOk() (*PortRange, bool) { - if o == nil || IsNil(o.PortRange) { - return nil, false - } - return o.PortRange, true +func (o *CreateSecurityGroupRulePayload) GetPortRangeOk() (ret CreateSecurityGroupRulePayloadGetPortRangeRetType, ok bool) { + return getCreateSecurityGroupRulePayloadGetPortRangeAttributeTypeOk(o.PortRange) } // HasPortRange returns a boolean if a field has been set. func (o *CreateSecurityGroupRulePayload) HasPortRange() bool { - if o != nil && !IsNil(o.PortRange) { - return true - } - - return false + _, ok := o.GetPortRangeOk() + return ok } // SetPortRange gets a reference to the given PortRange and assigns it to the PortRange field. -func (o *CreateSecurityGroupRulePayload) SetPortRange(v *PortRange) { - o.PortRange = v +func (o *CreateSecurityGroupRulePayload) SetPortRange(v CreateSecurityGroupRulePayloadGetPortRangeRetType) { + setCreateSecurityGroupRulePayloadGetPortRangeAttributeType(&o.PortRange, v) } // GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. -func (o *CreateSecurityGroupRulePayload) GetRemoteSecurityGroupId() *string { - if o == nil || IsNil(o.RemoteSecurityGroupId) { - var ret *string - return ret - } - return o.RemoteSecurityGroupId +func (o *CreateSecurityGroupRulePayload) GetRemoteSecurityGroupId() (res CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdRetType) { + res, _ = o.GetRemoteSecurityGroupIdOk() + return } // GetRemoteSecurityGroupIdOk returns a tuple with the RemoteSecurityGroupId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateSecurityGroupRulePayload) GetRemoteSecurityGroupIdOk() (*string, bool) { - if o == nil || IsNil(o.RemoteSecurityGroupId) { - return nil, false - } - return o.RemoteSecurityGroupId, true +func (o *CreateSecurityGroupRulePayload) GetRemoteSecurityGroupIdOk() (ret CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdRetType, ok bool) { + return getCreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeTypeOk(o.RemoteSecurityGroupId) } // HasRemoteSecurityGroupId returns a boolean if a field has been set. func (o *CreateSecurityGroupRulePayload) HasRemoteSecurityGroupId() bool { - if o != nil && !IsNil(o.RemoteSecurityGroupId) { - return true - } - - return false + _, ok := o.GetRemoteSecurityGroupIdOk() + return ok } // SetRemoteSecurityGroupId gets a reference to the given string and assigns it to the RemoteSecurityGroupId field. -func (o *CreateSecurityGroupRulePayload) SetRemoteSecurityGroupId(v *string) { - o.RemoteSecurityGroupId = v +func (o *CreateSecurityGroupRulePayload) SetRemoteSecurityGroupId(v CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdRetType) { + setCreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeType(&o.RemoteSecurityGroupId, v) } // GetSecurityGroupId returns the SecurityGroupId field value if set, zero value otherwise. -func (o *CreateSecurityGroupRulePayload) GetSecurityGroupId() *string { - if o == nil || IsNil(o.SecurityGroupId) { - var ret *string - return ret - } - return o.SecurityGroupId +func (o *CreateSecurityGroupRulePayload) GetSecurityGroupId() (res CreateSecurityGroupRulePayloadGetSecurityGroupIdRetType) { + res, _ = o.GetSecurityGroupIdOk() + return } // GetSecurityGroupIdOk returns a tuple with the SecurityGroupId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateSecurityGroupRulePayload) GetSecurityGroupIdOk() (*string, bool) { - if o == nil || IsNil(o.SecurityGroupId) { - return nil, false - } - return o.SecurityGroupId, true +func (o *CreateSecurityGroupRulePayload) GetSecurityGroupIdOk() (ret CreateSecurityGroupRulePayloadGetSecurityGroupIdRetType, ok bool) { + return getCreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeTypeOk(o.SecurityGroupId) } // HasSecurityGroupId returns a boolean if a field has been set. func (o *CreateSecurityGroupRulePayload) HasSecurityGroupId() bool { - if o != nil && !IsNil(o.SecurityGroupId) { - return true - } - - return false + _, ok := o.GetSecurityGroupIdOk() + return ok } // SetSecurityGroupId gets a reference to the given string and assigns it to the SecurityGroupId field. -func (o *CreateSecurityGroupRulePayload) SetSecurityGroupId(v *string) { - o.SecurityGroupId = v +func (o *CreateSecurityGroupRulePayload) SetSecurityGroupId(v CreateSecurityGroupRulePayloadGetSecurityGroupIdRetType) { + setCreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeType(&o.SecurityGroupId, v) } // GetProtocol returns the Protocol field value if set, zero value otherwise. -func (o *CreateSecurityGroupRulePayload) GetProtocol() *CreateProtocol { - if o == nil || IsNil(o.Protocol) { - var ret *CreateProtocol - return ret - } - return o.Protocol +func (o *CreateSecurityGroupRulePayload) GetProtocol() (res CreateSecurityGroupRulePayloadGetProtocolRetType) { + res, _ = o.GetProtocolOk() + return } // GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateSecurityGroupRulePayload) GetProtocolOk() (*CreateProtocol, bool) { - if o == nil || IsNil(o.Protocol) { - return nil, false - } - return o.Protocol, true +func (o *CreateSecurityGroupRulePayload) GetProtocolOk() (ret CreateSecurityGroupRulePayloadGetProtocolRetType, ok bool) { + return getCreateSecurityGroupRulePayloadGetProtocolAttributeTypeOk(o.Protocol) } // HasProtocol returns a boolean if a field has been set. func (o *CreateSecurityGroupRulePayload) HasProtocol() bool { - if o != nil && !IsNil(o.Protocol) { - return true - } - - return false + _, ok := o.GetProtocolOk() + return ok } // SetProtocol gets a reference to the given CreateProtocol and assigns it to the Protocol field. -func (o *CreateSecurityGroupRulePayload) SetProtocol(v *CreateProtocol) { - o.Protocol = v +func (o *CreateSecurityGroupRulePayload) SetProtocol(v CreateSecurityGroupRulePayloadGetProtocolRetType) { + setCreateSecurityGroupRulePayloadGetProtocolAttributeType(&o.Protocol, v) } func (o CreateSecurityGroupRulePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getCreateSecurityGroupRulePayloadGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getCreateSecurityGroupRulePayloadGetDirectionAttributeTypeOk(o.Direction); ok { + toSerialize["Direction"] = val } - toSerialize["direction"] = o.Direction - if !IsNil(o.Ethertype) { - toSerialize["ethertype"] = o.Ethertype + if val, ok := getCreateSecurityGroupRulePayloadGetEthertypeAttributeTypeOk(o.Ethertype); ok { + toSerialize["Ethertype"] = val } - if !IsNil(o.IcmpParameters) { - toSerialize["icmpParameters"] = o.IcmpParameters + if val, ok := getCreateSecurityGroupRulePayloadGetIcmpParametersAttributeTypeOk(o.IcmpParameters); ok { + toSerialize["IcmpParameters"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getCreateSecurityGroupRulePayloadGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.IpRange) { - toSerialize["ipRange"] = o.IpRange + if val, ok := getCreateSecurityGroupRulePayloadGetIpRangeAttributeTypeOk(o.IpRange); ok { + toSerialize["IpRange"] = val } - if !IsNil(o.PortRange) { - toSerialize["portRange"] = o.PortRange + if val, ok := getCreateSecurityGroupRulePayloadGetPortRangeAttributeTypeOk(o.PortRange); ok { + toSerialize["PortRange"] = val } - if !IsNil(o.RemoteSecurityGroupId) { - toSerialize["remoteSecurityGroupId"] = o.RemoteSecurityGroupId + if val, ok := getCreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeTypeOk(o.RemoteSecurityGroupId); ok { + toSerialize["RemoteSecurityGroupId"] = val } - if !IsNil(o.SecurityGroupId) { - toSerialize["securityGroupId"] = o.SecurityGroupId + if val, ok := getCreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeTypeOk(o.SecurityGroupId); ok { + toSerialize["SecurityGroupId"] = val } - if !IsNil(o.Protocol) { - toSerialize["protocol"] = o.Protocol + if val, ok := getCreateSecurityGroupRulePayloadGetProtocolAttributeTypeOk(o.Protocol); ok { + toSerialize["Protocol"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_security_group_rule_protocol.go b/services/iaas/model_create_security_group_rule_protocol.go index ae955a538..b2e727575 100644 --- a/services/iaas/model_create_security_group_rule_protocol.go +++ b/services/iaas/model_create_security_group_rule_protocol.go @@ -17,9 +17,29 @@ import ( // checks if the CreateSecurityGroupRuleProtocol type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateSecurityGroupRuleProtocol{} +/* + types and functions for protocol +*/ + +// isModel +type CreateSecurityGroupRuleProtocolGetProtocolAttributeType = *CreateProtocol +type CreateSecurityGroupRuleProtocolGetProtocolArgType = CreateProtocol +type CreateSecurityGroupRuleProtocolGetProtocolRetType = CreateProtocol + +func getCreateSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(arg CreateSecurityGroupRuleProtocolGetProtocolAttributeType) (ret CreateSecurityGroupRuleProtocolGetProtocolRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSecurityGroupRuleProtocolGetProtocolAttributeType(arg *CreateSecurityGroupRuleProtocolGetProtocolAttributeType, val CreateSecurityGroupRuleProtocolGetProtocolRetType) { + *arg = &val +} + // CreateSecurityGroupRuleProtocol The internet protocol which the rule should match. type CreateSecurityGroupRuleProtocol struct { - Protocol *CreateProtocol `json:"protocol,omitempty"` + Protocol CreateSecurityGroupRuleProtocolGetProtocolAttributeType `json:"protocol,omitempty"` } // NewCreateSecurityGroupRuleProtocol instantiates a new CreateSecurityGroupRuleProtocol object @@ -40,41 +60,32 @@ func NewCreateSecurityGroupRuleProtocolWithDefaults() *CreateSecurityGroupRulePr } // GetProtocol returns the Protocol field value if set, zero value otherwise. -func (o *CreateSecurityGroupRuleProtocol) GetProtocol() *CreateProtocol { - if o == nil || IsNil(o.Protocol) { - var ret *CreateProtocol - return ret - } - return o.Protocol +func (o *CreateSecurityGroupRuleProtocol) GetProtocol() (res CreateSecurityGroupRuleProtocolGetProtocolRetType) { + res, _ = o.GetProtocolOk() + return } // GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateSecurityGroupRuleProtocol) GetProtocolOk() (*CreateProtocol, bool) { - if o == nil || IsNil(o.Protocol) { - return nil, false - } - return o.Protocol, true +func (o *CreateSecurityGroupRuleProtocol) GetProtocolOk() (ret CreateSecurityGroupRuleProtocolGetProtocolRetType, ok bool) { + return getCreateSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(o.Protocol) } // HasProtocol returns a boolean if a field has been set. func (o *CreateSecurityGroupRuleProtocol) HasProtocol() bool { - if o != nil && !IsNil(o.Protocol) { - return true - } - - return false + _, ok := o.GetProtocolOk() + return ok } // SetProtocol gets a reference to the given CreateProtocol and assigns it to the Protocol field. -func (o *CreateSecurityGroupRuleProtocol) SetProtocol(v *CreateProtocol) { - o.Protocol = v +func (o *CreateSecurityGroupRuleProtocol) SetProtocol(v CreateSecurityGroupRuleProtocolGetProtocolRetType) { + setCreateSecurityGroupRuleProtocolGetProtocolAttributeType(&o.Protocol, v) } func (o CreateSecurityGroupRuleProtocol) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Protocol) { - toSerialize["protocol"] = o.Protocol + if val, ok := getCreateSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(o.Protocol); ok { + toSerialize["Protocol"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_server_networking.go b/services/iaas/model_create_server_networking.go index afbe456d4..460e7bc60 100644 --- a/services/iaas/model_create_server_networking.go +++ b/services/iaas/model_create_server_networking.go @@ -17,10 +17,31 @@ import ( // checks if the CreateServerNetworking type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateServerNetworking{} +/* + types and functions for networkId +*/ + +// isNotNullableString +type CreateServerNetworkingGetNetworkIdAttributeType = *string + +func getCreateServerNetworkingGetNetworkIdAttributeTypeOk(arg CreateServerNetworkingGetNetworkIdAttributeType) (ret CreateServerNetworkingGetNetworkIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerNetworkingGetNetworkIdAttributeType(arg *CreateServerNetworkingGetNetworkIdAttributeType, val CreateServerNetworkingGetNetworkIdRetType) { + *arg = &val +} + +type CreateServerNetworkingGetNetworkIdArgType = string +type CreateServerNetworkingGetNetworkIdRetType = string + // CreateServerNetworking The initial networking setup for the server creation with a network. type CreateServerNetworking struct { // Universally Unique Identifier (UUID). - NetworkId *string `json:"networkId,omitempty"` + NetworkId CreateServerNetworkingGetNetworkIdAttributeType `json:"networkId,omitempty"` } // NewCreateServerNetworking instantiates a new CreateServerNetworking object @@ -41,41 +62,32 @@ func NewCreateServerNetworkingWithDefaults() *CreateServerNetworking { } // GetNetworkId returns the NetworkId field value if set, zero value otherwise. -func (o *CreateServerNetworking) GetNetworkId() *string { - if o == nil || IsNil(o.NetworkId) { - var ret *string - return ret - } - return o.NetworkId +func (o *CreateServerNetworking) GetNetworkId() (res CreateServerNetworkingGetNetworkIdRetType) { + res, _ = o.GetNetworkIdOk() + return } // GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerNetworking) GetNetworkIdOk() (*string, bool) { - if o == nil || IsNil(o.NetworkId) { - return nil, false - } - return o.NetworkId, true +func (o *CreateServerNetworking) GetNetworkIdOk() (ret CreateServerNetworkingGetNetworkIdRetType, ok bool) { + return getCreateServerNetworkingGetNetworkIdAttributeTypeOk(o.NetworkId) } // HasNetworkId returns a boolean if a field has been set. func (o *CreateServerNetworking) HasNetworkId() bool { - if o != nil && !IsNil(o.NetworkId) { - return true - } - - return false + _, ok := o.GetNetworkIdOk() + return ok } // SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. -func (o *CreateServerNetworking) SetNetworkId(v *string) { - o.NetworkId = v +func (o *CreateServerNetworking) SetNetworkId(v CreateServerNetworkingGetNetworkIdRetType) { + setCreateServerNetworkingGetNetworkIdAttributeType(&o.NetworkId, v) } func (o CreateServerNetworking) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.NetworkId) { - toSerialize["networkId"] = o.NetworkId + if val, ok := getCreateServerNetworkingGetNetworkIdAttributeTypeOk(o.NetworkId); ok { + toSerialize["NetworkId"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_server_networking_with_nics.go b/services/iaas/model_create_server_networking_with_nics.go index 867a2fca7..e6e0fa73b 100644 --- a/services/iaas/model_create_server_networking_with_nics.go +++ b/services/iaas/model_create_server_networking_with_nics.go @@ -17,10 +17,30 @@ import ( // checks if the CreateServerNetworkingWithNics type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateServerNetworkingWithNics{} +/* + types and functions for nicIds +*/ + +// isArray +type CreateServerNetworkingWithNicsGetNicIdsAttributeType = *[]string +type CreateServerNetworkingWithNicsGetNicIdsArgType = []string +type CreateServerNetworkingWithNicsGetNicIdsRetType = []string + +func getCreateServerNetworkingWithNicsGetNicIdsAttributeTypeOk(arg CreateServerNetworkingWithNicsGetNicIdsAttributeType) (ret CreateServerNetworkingWithNicsGetNicIdsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerNetworkingWithNicsGetNicIdsAttributeType(arg *CreateServerNetworkingWithNicsGetNicIdsAttributeType, val CreateServerNetworkingWithNicsGetNicIdsRetType) { + *arg = &val +} + // CreateServerNetworkingWithNics The initial networking setup for the server creation with a network interface. type CreateServerNetworkingWithNics struct { // A list of UUIDs. - NicIds *[]string `json:"nicIds,omitempty"` + NicIds CreateServerNetworkingWithNicsGetNicIdsAttributeType `json:"nicIds,omitempty"` } // NewCreateServerNetworkingWithNics instantiates a new CreateServerNetworkingWithNics object @@ -41,41 +61,32 @@ func NewCreateServerNetworkingWithNicsWithDefaults() *CreateServerNetworkingWith } // GetNicIds returns the NicIds field value if set, zero value otherwise. -func (o *CreateServerNetworkingWithNics) GetNicIds() *[]string { - if o == nil || IsNil(o.NicIds) { - var ret *[]string - return ret - } - return o.NicIds +func (o *CreateServerNetworkingWithNics) GetNicIds() (res CreateServerNetworkingWithNicsGetNicIdsRetType) { + res, _ = o.GetNicIdsOk() + return } // GetNicIdsOk returns a tuple with the NicIds field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerNetworkingWithNics) GetNicIdsOk() (*[]string, bool) { - if o == nil || IsNil(o.NicIds) { - return nil, false - } - return o.NicIds, true +func (o *CreateServerNetworkingWithNics) GetNicIdsOk() (ret CreateServerNetworkingWithNicsGetNicIdsRetType, ok bool) { + return getCreateServerNetworkingWithNicsGetNicIdsAttributeTypeOk(o.NicIds) } // HasNicIds returns a boolean if a field has been set. func (o *CreateServerNetworkingWithNics) HasNicIds() bool { - if o != nil && !IsNil(o.NicIds) { - return true - } - - return false + _, ok := o.GetNicIdsOk() + return ok } // SetNicIds gets a reference to the given []string and assigns it to the NicIds field. -func (o *CreateServerNetworkingWithNics) SetNicIds(v *[]string) { - o.NicIds = v +func (o *CreateServerNetworkingWithNics) SetNicIds(v CreateServerNetworkingWithNicsGetNicIdsRetType) { + setCreateServerNetworkingWithNicsGetNicIdsAttributeType(&o.NicIds, v) } func (o CreateServerNetworkingWithNics) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.NicIds) { - toSerialize["nicIds"] = o.NicIds + if val, ok := getCreateServerNetworkingWithNicsGetNicIdsAttributeTypeOk(o.NicIds); ok { + toSerialize["NicIds"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_server_payload.go b/services/iaas/model_create_server_payload.go index b711f12cd..9249084fd 100644 --- a/services/iaas/model_create_server_payload.go +++ b/services/iaas/model_create_server_payload.go @@ -18,51 +18,501 @@ import ( // checks if the CreateServerPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateServerPayload{} +/* + types and functions for affinityGroup +*/ + +// isNotNullableString +type CreateServerPayloadGetAffinityGroupAttributeType = *string + +func getCreateServerPayloadGetAffinityGroupAttributeTypeOk(arg CreateServerPayloadGetAffinityGroupAttributeType) (ret CreateServerPayloadGetAffinityGroupRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetAffinityGroupAttributeType(arg *CreateServerPayloadGetAffinityGroupAttributeType, val CreateServerPayloadGetAffinityGroupRetType) { + *arg = &val +} + +type CreateServerPayloadGetAffinityGroupArgType = string +type CreateServerPayloadGetAffinityGroupRetType = string + +/* + types and functions for availabilityZone +*/ + +// isNotNullableString +type CreateServerPayloadGetAvailabilityZoneAttributeType = *string + +func getCreateServerPayloadGetAvailabilityZoneAttributeTypeOk(arg CreateServerPayloadGetAvailabilityZoneAttributeType) (ret CreateServerPayloadGetAvailabilityZoneRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetAvailabilityZoneAttributeType(arg *CreateServerPayloadGetAvailabilityZoneAttributeType, val CreateServerPayloadGetAvailabilityZoneRetType) { + *arg = &val +} + +type CreateServerPayloadGetAvailabilityZoneArgType = string +type CreateServerPayloadGetAvailabilityZoneRetType = string + +/* + types and functions for bootVolume +*/ + +// isModel +type CreateServerPayloadGetBootVolumeAttributeType = *CreateServerPayloadBootVolume +type CreateServerPayloadGetBootVolumeArgType = CreateServerPayloadBootVolume +type CreateServerPayloadGetBootVolumeRetType = CreateServerPayloadBootVolume + +func getCreateServerPayloadGetBootVolumeAttributeTypeOk(arg CreateServerPayloadGetBootVolumeAttributeType) (ret CreateServerPayloadGetBootVolumeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetBootVolumeAttributeType(arg *CreateServerPayloadGetBootVolumeAttributeType, val CreateServerPayloadGetBootVolumeRetType) { + *arg = &val +} + +/* + types and functions for createdAt +*/ + +// isDateTime +type CreateServerPayloadGetCreatedAtAttributeType = *time.Time +type CreateServerPayloadGetCreatedAtArgType = time.Time +type CreateServerPayloadGetCreatedAtRetType = time.Time + +func getCreateServerPayloadGetCreatedAtAttributeTypeOk(arg CreateServerPayloadGetCreatedAtAttributeType) (ret CreateServerPayloadGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetCreatedAtAttributeType(arg *CreateServerPayloadGetCreatedAtAttributeType, val CreateServerPayloadGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for errorMessage +*/ + +// isNotNullableString +type CreateServerPayloadGetErrorMessageAttributeType = *string + +func getCreateServerPayloadGetErrorMessageAttributeTypeOk(arg CreateServerPayloadGetErrorMessageAttributeType) (ret CreateServerPayloadGetErrorMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetErrorMessageAttributeType(arg *CreateServerPayloadGetErrorMessageAttributeType, val CreateServerPayloadGetErrorMessageRetType) { + *arg = &val +} + +type CreateServerPayloadGetErrorMessageArgType = string +type CreateServerPayloadGetErrorMessageRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type CreateServerPayloadGetIdAttributeType = *string + +func getCreateServerPayloadGetIdAttributeTypeOk(arg CreateServerPayloadGetIdAttributeType) (ret CreateServerPayloadGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetIdAttributeType(arg *CreateServerPayloadGetIdAttributeType, val CreateServerPayloadGetIdRetType) { + *arg = &val +} + +type CreateServerPayloadGetIdArgType = string +type CreateServerPayloadGetIdRetType = string + +/* + types and functions for imageId +*/ + +// isNotNullableString +type CreateServerPayloadGetImageIdAttributeType = *string + +func getCreateServerPayloadGetImageIdAttributeTypeOk(arg CreateServerPayloadGetImageIdAttributeType) (ret CreateServerPayloadGetImageIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetImageIdAttributeType(arg *CreateServerPayloadGetImageIdAttributeType, val CreateServerPayloadGetImageIdRetType) { + *arg = &val +} + +type CreateServerPayloadGetImageIdArgType = string +type CreateServerPayloadGetImageIdRetType = string + +/* + types and functions for keypairName +*/ + +// isNotNullableString +type CreateServerPayloadGetKeypairNameAttributeType = *string + +func getCreateServerPayloadGetKeypairNameAttributeTypeOk(arg CreateServerPayloadGetKeypairNameAttributeType) (ret CreateServerPayloadGetKeypairNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetKeypairNameAttributeType(arg *CreateServerPayloadGetKeypairNameAttributeType, val CreateServerPayloadGetKeypairNameRetType) { + *arg = &val +} + +type CreateServerPayloadGetKeypairNameArgType = string +type CreateServerPayloadGetKeypairNameRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type CreateServerPayloadGetLabelsAttributeType = *map[string]interface{} +type CreateServerPayloadGetLabelsArgType = map[string]interface{} +type CreateServerPayloadGetLabelsRetType = map[string]interface{} + +func getCreateServerPayloadGetLabelsAttributeTypeOk(arg CreateServerPayloadGetLabelsAttributeType) (ret CreateServerPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetLabelsAttributeType(arg *CreateServerPayloadGetLabelsAttributeType, val CreateServerPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for launchedAt +*/ + +// isDateTime +type CreateServerPayloadGetLaunchedAtAttributeType = *time.Time +type CreateServerPayloadGetLaunchedAtArgType = time.Time +type CreateServerPayloadGetLaunchedAtRetType = time.Time + +func getCreateServerPayloadGetLaunchedAtAttributeTypeOk(arg CreateServerPayloadGetLaunchedAtAttributeType) (ret CreateServerPayloadGetLaunchedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetLaunchedAtAttributeType(arg *CreateServerPayloadGetLaunchedAtAttributeType, val CreateServerPayloadGetLaunchedAtRetType) { + *arg = &val +} + +/* + types and functions for machineType +*/ + +// isNotNullableString +type CreateServerPayloadGetMachineTypeAttributeType = *string + +func getCreateServerPayloadGetMachineTypeAttributeTypeOk(arg CreateServerPayloadGetMachineTypeAttributeType) (ret CreateServerPayloadGetMachineTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetMachineTypeAttributeType(arg *CreateServerPayloadGetMachineTypeAttributeType, val CreateServerPayloadGetMachineTypeRetType) { + *arg = &val +} + +type CreateServerPayloadGetMachineTypeArgType = string +type CreateServerPayloadGetMachineTypeRetType = string + +/* + types and functions for maintenanceWindow +*/ + +// isModel +type CreateServerPayloadGetMaintenanceWindowAttributeType = *ServerMaintenance +type CreateServerPayloadGetMaintenanceWindowArgType = ServerMaintenance +type CreateServerPayloadGetMaintenanceWindowRetType = ServerMaintenance + +func getCreateServerPayloadGetMaintenanceWindowAttributeTypeOk(arg CreateServerPayloadGetMaintenanceWindowAttributeType) (ret CreateServerPayloadGetMaintenanceWindowRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetMaintenanceWindowAttributeType(arg *CreateServerPayloadGetMaintenanceWindowAttributeType, val CreateServerPayloadGetMaintenanceWindowRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateServerPayloadGetNameAttributeType = *string + +func getCreateServerPayloadGetNameAttributeTypeOk(arg CreateServerPayloadGetNameAttributeType) (ret CreateServerPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetNameAttributeType(arg *CreateServerPayloadGetNameAttributeType, val CreateServerPayloadGetNameRetType) { + *arg = &val +} + +type CreateServerPayloadGetNameArgType = string +type CreateServerPayloadGetNameRetType = string + +/* + types and functions for networking +*/ + +// isModel +type CreateServerPayloadGetNetworkingAttributeType = *CreateServerPayloadNetworking +type CreateServerPayloadGetNetworkingArgType = CreateServerPayloadNetworking +type CreateServerPayloadGetNetworkingRetType = CreateServerPayloadNetworking + +func getCreateServerPayloadGetNetworkingAttributeTypeOk(arg CreateServerPayloadGetNetworkingAttributeType) (ret CreateServerPayloadGetNetworkingRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetNetworkingAttributeType(arg *CreateServerPayloadGetNetworkingAttributeType, val CreateServerPayloadGetNetworkingRetType) { + *arg = &val +} + +/* + types and functions for nics +*/ + +// isArray +type CreateServerPayloadGetNicsAttributeType = *[]ServerNetwork +type CreateServerPayloadGetNicsArgType = []ServerNetwork +type CreateServerPayloadGetNicsRetType = []ServerNetwork + +func getCreateServerPayloadGetNicsAttributeTypeOk(arg CreateServerPayloadGetNicsAttributeType) (ret CreateServerPayloadGetNicsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetNicsAttributeType(arg *CreateServerPayloadGetNicsAttributeType, val CreateServerPayloadGetNicsRetType) { + *arg = &val +} + +/* + types and functions for powerStatus +*/ + +// isNotNullableString +type CreateServerPayloadGetPowerStatusAttributeType = *string + +func getCreateServerPayloadGetPowerStatusAttributeTypeOk(arg CreateServerPayloadGetPowerStatusAttributeType) (ret CreateServerPayloadGetPowerStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetPowerStatusAttributeType(arg *CreateServerPayloadGetPowerStatusAttributeType, val CreateServerPayloadGetPowerStatusRetType) { + *arg = &val +} + +type CreateServerPayloadGetPowerStatusArgType = string +type CreateServerPayloadGetPowerStatusRetType = string + +/* + types and functions for securityGroups +*/ + +// isArray +type CreateServerPayloadGetSecurityGroupsAttributeType = *[]string +type CreateServerPayloadGetSecurityGroupsArgType = []string +type CreateServerPayloadGetSecurityGroupsRetType = []string + +func getCreateServerPayloadGetSecurityGroupsAttributeTypeOk(arg CreateServerPayloadGetSecurityGroupsAttributeType) (ret CreateServerPayloadGetSecurityGroupsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetSecurityGroupsAttributeType(arg *CreateServerPayloadGetSecurityGroupsAttributeType, val CreateServerPayloadGetSecurityGroupsRetType) { + *arg = &val +} + +/* + types and functions for serviceAccountMails +*/ + +// isArray +type CreateServerPayloadGetServiceAccountMailsAttributeType = *[]string +type CreateServerPayloadGetServiceAccountMailsArgType = []string +type CreateServerPayloadGetServiceAccountMailsRetType = []string + +func getCreateServerPayloadGetServiceAccountMailsAttributeTypeOk(arg CreateServerPayloadGetServiceAccountMailsAttributeType) (ret CreateServerPayloadGetServiceAccountMailsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetServiceAccountMailsAttributeType(arg *CreateServerPayloadGetServiceAccountMailsAttributeType, val CreateServerPayloadGetServiceAccountMailsRetType) { + *arg = &val +} + +/* + types and functions for status +*/ + +// isNotNullableString +type CreateServerPayloadGetStatusAttributeType = *string + +func getCreateServerPayloadGetStatusAttributeTypeOk(arg CreateServerPayloadGetStatusAttributeType) (ret CreateServerPayloadGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetStatusAttributeType(arg *CreateServerPayloadGetStatusAttributeType, val CreateServerPayloadGetStatusRetType) { + *arg = &val +} + +type CreateServerPayloadGetStatusArgType = string +type CreateServerPayloadGetStatusRetType = string + +/* + types and functions for updatedAt +*/ + +// isDateTime +type CreateServerPayloadGetUpdatedAtAttributeType = *time.Time +type CreateServerPayloadGetUpdatedAtArgType = time.Time +type CreateServerPayloadGetUpdatedAtRetType = time.Time + +func getCreateServerPayloadGetUpdatedAtAttributeTypeOk(arg CreateServerPayloadGetUpdatedAtAttributeType) (ret CreateServerPayloadGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetUpdatedAtAttributeType(arg *CreateServerPayloadGetUpdatedAtAttributeType, val CreateServerPayloadGetUpdatedAtRetType) { + *arg = &val +} + +/* + types and functions for userData +*/ + +// isByteArray +type CreateServerPayloadGetUserDataAttributeType = *[]byte +type CreateServerPayloadGetUserDataArgType = []byte +type CreateServerPayloadGetUserDataRetType = []byte + +func getCreateServerPayloadGetUserDataAttributeTypeOk(arg CreateServerPayloadGetUserDataAttributeType) (ret CreateServerPayloadGetUserDataRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetUserDataAttributeType(arg *CreateServerPayloadGetUserDataAttributeType, val CreateServerPayloadGetUserDataRetType) { + *arg = &val +} + +/* + types and functions for volumes +*/ + +// isArray +type CreateServerPayloadGetVolumesAttributeType = *[]string +type CreateServerPayloadGetVolumesArgType = []string +type CreateServerPayloadGetVolumesRetType = []string + +func getCreateServerPayloadGetVolumesAttributeTypeOk(arg CreateServerPayloadGetVolumesAttributeType) (ret CreateServerPayloadGetVolumesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetVolumesAttributeType(arg *CreateServerPayloadGetVolumesAttributeType, val CreateServerPayloadGetVolumesRetType) { + *arg = &val +} + // CreateServerPayload Representation of a single server object. type CreateServerPayload struct { // Universally Unique Identifier (UUID). - AffinityGroup *string `json:"affinityGroup,omitempty"` + AffinityGroup CreateServerPayloadGetAffinityGroupAttributeType `json:"affinityGroup,omitempty"` // Object that represents an availability zone. - AvailabilityZone *string `json:"availabilityZone,omitempty"` - BootVolume *CreateServerPayloadBootVolume `json:"bootVolume,omitempty"` + AvailabilityZone CreateServerPayloadGetAvailabilityZoneAttributeType `json:"availabilityZone,omitempty"` + BootVolume CreateServerPayloadGetBootVolumeAttributeType `json:"bootVolume,omitempty"` // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt CreateServerPayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` // An error message. - ErrorMessage *string `json:"errorMessage,omitempty"` + ErrorMessage CreateServerPayloadGetErrorMessageAttributeType `json:"errorMessage,omitempty"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id CreateServerPayloadGetIdAttributeType `json:"id,omitempty"` // Universally Unique Identifier (UUID). - ImageId *string `json:"imageId,omitempty"` + ImageId CreateServerPayloadGetImageIdAttributeType `json:"imageId,omitempty"` // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. - KeypairName *string `json:"keypairName,omitempty"` + KeypairName CreateServerPayloadGetKeypairNameAttributeType `json:"keypairName,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels CreateServerPayloadGetLabelsAttributeType `json:"labels,omitempty"` // Date-time when resource was launched. - LaunchedAt *time.Time `json:"launchedAt,omitempty"` + LaunchedAt CreateServerPayloadGetLaunchedAtAttributeType `json:"launchedAt,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED - MachineType *string `json:"machineType"` - MaintenanceWindow *ServerMaintenance `json:"maintenanceWindow,omitempty"` + MachineType CreateServerPayloadGetMachineTypeAttributeType `json:"machineType"` + MaintenanceWindow CreateServerPayloadGetMaintenanceWindowAttributeType `json:"maintenanceWindow,omitempty"` // The name for a Server. // REQUIRED - Name *string `json:"name"` - Networking *CreateServerPayloadNetworking `json:"networking,omitempty"` + Name CreateServerPayloadGetNameAttributeType `json:"name"` + Networking CreateServerPayloadGetNetworkingAttributeType `json:"networking,omitempty"` // A list of networks attached to a server. - Nics *[]ServerNetwork `json:"nics,omitempty"` + Nics CreateServerPayloadGetNicsAttributeType `json:"nics,omitempty"` // The power status of a server. Possible values: `CRASHED`, `ERROR`, `RUNNING`, `STOPPED`. - PowerStatus *string `json:"powerStatus,omitempty"` + PowerStatus CreateServerPayloadGetPowerStatusAttributeType `json:"powerStatus,omitempty"` // A list of General Objects. - SecurityGroups *[]string `json:"securityGroups,omitempty"` + SecurityGroups CreateServerPayloadGetSecurityGroupsAttributeType `json:"securityGroups,omitempty"` // A list of service account mails. - ServiceAccountMails *[]string `json:"serviceAccountMails,omitempty"` + ServiceAccountMails CreateServerPayloadGetServiceAccountMailsAttributeType `json:"serviceAccountMails,omitempty"` // The status of a server object. Possible values: `ACTIVE`, `BACKING-UP`, `CREATING`, `DEALLOCATED`, `DEALLOCATING`, `DELETED`, `DELETING`, `ERROR`, `INACTIVE`, `MIGRATING`, `REBOOT`, `REBOOTING`, `REBUILD`, `REBUILDING`, `RESCUE`, `RESCUING`, `RESIZING`, `RESTORING`, `SNAPSHOTTING`, `STARTING`, `STOPPING`, `UNRESCUING`, `UPDATING`. - Status *string `json:"status,omitempty"` + Status CreateServerPayloadGetStatusAttributeType `json:"status,omitempty"` // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAt CreateServerPayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` // User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init to the server. - UserData *string `json:"userData,omitempty"` + UserData CreateServerPayloadGetUserDataAttributeType `json:"userData,omitempty"` // A list of UUIDs. - Volumes *[]string `json:"volumes,omitempty"` + Volumes CreateServerPayloadGetVolumesAttributeType `json:"volumes,omitempty"` } type _CreateServerPayload CreateServerPayload @@ -71,10 +521,10 @@ type _CreateServerPayload CreateServerPayload // 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 NewCreateServerPayload(machineType *string, name *string) *CreateServerPayload { +func NewCreateServerPayload(machineType CreateServerPayloadGetMachineTypeArgType, name CreateServerPayloadGetNameArgType) *CreateServerPayload { this := CreateServerPayload{} - this.MachineType = machineType - this.Name = name + setCreateServerPayloadGetMachineTypeAttributeType(&this.MachineType, machineType) + setCreateServerPayloadGetNameAttributeType(&this.Name, name) return &this } @@ -87,756 +537,566 @@ func NewCreateServerPayloadWithDefaults() *CreateServerPayload { } // GetAffinityGroup returns the AffinityGroup field value if set, zero value otherwise. -func (o *CreateServerPayload) GetAffinityGroup() *string { - if o == nil || IsNil(o.AffinityGroup) { - var ret *string - return ret - } - return o.AffinityGroup +func (o *CreateServerPayload) GetAffinityGroup() (res CreateServerPayloadGetAffinityGroupRetType) { + res, _ = o.GetAffinityGroupOk() + return } // GetAffinityGroupOk returns a tuple with the AffinityGroup field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetAffinityGroupOk() (*string, bool) { - if o == nil || IsNil(o.AffinityGroup) { - return nil, false - } - return o.AffinityGroup, true +func (o *CreateServerPayload) GetAffinityGroupOk() (ret CreateServerPayloadGetAffinityGroupRetType, ok bool) { + return getCreateServerPayloadGetAffinityGroupAttributeTypeOk(o.AffinityGroup) } // HasAffinityGroup returns a boolean if a field has been set. func (o *CreateServerPayload) HasAffinityGroup() bool { - if o != nil && !IsNil(o.AffinityGroup) { - return true - } - - return false + _, ok := o.GetAffinityGroupOk() + return ok } // SetAffinityGroup gets a reference to the given string and assigns it to the AffinityGroup field. -func (o *CreateServerPayload) SetAffinityGroup(v *string) { - o.AffinityGroup = v +func (o *CreateServerPayload) SetAffinityGroup(v CreateServerPayloadGetAffinityGroupRetType) { + setCreateServerPayloadGetAffinityGroupAttributeType(&o.AffinityGroup, v) } // GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. -func (o *CreateServerPayload) GetAvailabilityZone() *string { - if o == nil || IsNil(o.AvailabilityZone) { - var ret *string - return ret - } - return o.AvailabilityZone +func (o *CreateServerPayload) GetAvailabilityZone() (res CreateServerPayloadGetAvailabilityZoneRetType) { + res, _ = o.GetAvailabilityZoneOk() + return } // GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetAvailabilityZoneOk() (*string, bool) { - if o == nil || IsNil(o.AvailabilityZone) { - return nil, false - } - return o.AvailabilityZone, true +func (o *CreateServerPayload) GetAvailabilityZoneOk() (ret CreateServerPayloadGetAvailabilityZoneRetType, ok bool) { + return getCreateServerPayloadGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) } // HasAvailabilityZone returns a boolean if a field has been set. func (o *CreateServerPayload) HasAvailabilityZone() bool { - if o != nil && !IsNil(o.AvailabilityZone) { - return true - } - - return false + _, ok := o.GetAvailabilityZoneOk() + return ok } // SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. -func (o *CreateServerPayload) SetAvailabilityZone(v *string) { - o.AvailabilityZone = v +func (o *CreateServerPayload) SetAvailabilityZone(v CreateServerPayloadGetAvailabilityZoneRetType) { + setCreateServerPayloadGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) } // GetBootVolume returns the BootVolume field value if set, zero value otherwise. -func (o *CreateServerPayload) GetBootVolume() *CreateServerPayloadBootVolume { - if o == nil || IsNil(o.BootVolume) { - var ret *CreateServerPayloadBootVolume - return ret - } - return o.BootVolume +func (o *CreateServerPayload) GetBootVolume() (res CreateServerPayloadGetBootVolumeRetType) { + res, _ = o.GetBootVolumeOk() + return } // GetBootVolumeOk returns a tuple with the BootVolume field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetBootVolumeOk() (*CreateServerPayloadBootVolume, bool) { - if o == nil || IsNil(o.BootVolume) { - return nil, false - } - return o.BootVolume, true +func (o *CreateServerPayload) GetBootVolumeOk() (ret CreateServerPayloadGetBootVolumeRetType, ok bool) { + return getCreateServerPayloadGetBootVolumeAttributeTypeOk(o.BootVolume) } // HasBootVolume returns a boolean if a field has been set. func (o *CreateServerPayload) HasBootVolume() bool { - if o != nil && !IsNil(o.BootVolume) { - return true - } - - return false + _, ok := o.GetBootVolumeOk() + return ok } // SetBootVolume gets a reference to the given CreateServerPayloadBootVolume and assigns it to the BootVolume field. -func (o *CreateServerPayload) SetBootVolume(v *CreateServerPayloadBootVolume) { - o.BootVolume = v +func (o *CreateServerPayload) SetBootVolume(v CreateServerPayloadGetBootVolumeRetType) { + setCreateServerPayloadGetBootVolumeAttributeType(&o.BootVolume, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *CreateServerPayload) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - return o.CreatedAt +func (o *CreateServerPayload) GetCreatedAt() (res CreateServerPayloadGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return } // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true +func (o *CreateServerPayload) GetCreatedAtOk() (ret CreateServerPayloadGetCreatedAtRetType, ok bool) { + return getCreateServerPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. func (o *CreateServerPayload) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false + _, ok := o.GetCreatedAtOk() + return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *CreateServerPayload) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *CreateServerPayload) SetCreatedAt(v CreateServerPayloadGetCreatedAtRetType) { + setCreateServerPayloadGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. -func (o *CreateServerPayload) GetErrorMessage() *string { - if o == nil || IsNil(o.ErrorMessage) { - var ret *string - return ret - } - return o.ErrorMessage +func (o *CreateServerPayload) GetErrorMessage() (res CreateServerPayloadGetErrorMessageRetType) { + res, _ = o.GetErrorMessageOk() + return } // GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetErrorMessageOk() (*string, bool) { - if o == nil || IsNil(o.ErrorMessage) { - return nil, false - } - return o.ErrorMessage, true +func (o *CreateServerPayload) GetErrorMessageOk() (ret CreateServerPayloadGetErrorMessageRetType, ok bool) { + return getCreateServerPayloadGetErrorMessageAttributeTypeOk(o.ErrorMessage) } // HasErrorMessage returns a boolean if a field has been set. func (o *CreateServerPayload) HasErrorMessage() bool { - if o != nil && !IsNil(o.ErrorMessage) { - return true - } - - return false + _, ok := o.GetErrorMessageOk() + return ok } // SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. -func (o *CreateServerPayload) SetErrorMessage(v *string) { - o.ErrorMessage = v +func (o *CreateServerPayload) SetErrorMessage(v CreateServerPayloadGetErrorMessageRetType) { + setCreateServerPayloadGetErrorMessageAttributeType(&o.ErrorMessage, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *CreateServerPayload) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *CreateServerPayload) GetId() (res CreateServerPayloadGetIdRetType) { + 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 *CreateServerPayload) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *CreateServerPayload) GetIdOk() (ret CreateServerPayloadGetIdRetType, ok bool) { + return getCreateServerPayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *CreateServerPayload) 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 *CreateServerPayload) SetId(v *string) { - o.Id = v +func (o *CreateServerPayload) SetId(v CreateServerPayloadGetIdRetType) { + setCreateServerPayloadGetIdAttributeType(&o.Id, v) } // GetImageId returns the ImageId field value if set, zero value otherwise. -func (o *CreateServerPayload) GetImageId() *string { - if o == nil || IsNil(o.ImageId) { - var ret *string - return ret - } - return o.ImageId +func (o *CreateServerPayload) GetImageId() (res CreateServerPayloadGetImageIdRetType) { + res, _ = o.GetImageIdOk() + return } // GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetImageIdOk() (*string, bool) { - if o == nil || IsNil(o.ImageId) { - return nil, false - } - return o.ImageId, true +func (o *CreateServerPayload) GetImageIdOk() (ret CreateServerPayloadGetImageIdRetType, ok bool) { + return getCreateServerPayloadGetImageIdAttributeTypeOk(o.ImageId) } // HasImageId returns a boolean if a field has been set. func (o *CreateServerPayload) HasImageId() bool { - if o != nil && !IsNil(o.ImageId) { - return true - } - - return false + _, ok := o.GetImageIdOk() + return ok } // SetImageId gets a reference to the given string and assigns it to the ImageId field. -func (o *CreateServerPayload) SetImageId(v *string) { - o.ImageId = v +func (o *CreateServerPayload) SetImageId(v CreateServerPayloadGetImageIdRetType) { + setCreateServerPayloadGetImageIdAttributeType(&o.ImageId, v) } // GetKeypairName returns the KeypairName field value if set, zero value otherwise. -func (o *CreateServerPayload) GetKeypairName() *string { - if o == nil || IsNil(o.KeypairName) { - var ret *string - return ret - } - return o.KeypairName +func (o *CreateServerPayload) GetKeypairName() (res CreateServerPayloadGetKeypairNameRetType) { + res, _ = o.GetKeypairNameOk() + return } // GetKeypairNameOk returns a tuple with the KeypairName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetKeypairNameOk() (*string, bool) { - if o == nil || IsNil(o.KeypairName) { - return nil, false - } - return o.KeypairName, true +func (o *CreateServerPayload) GetKeypairNameOk() (ret CreateServerPayloadGetKeypairNameRetType, ok bool) { + return getCreateServerPayloadGetKeypairNameAttributeTypeOk(o.KeypairName) } // HasKeypairName returns a boolean if a field has been set. func (o *CreateServerPayload) HasKeypairName() bool { - if o != nil && !IsNil(o.KeypairName) { - return true - } - - return false + _, ok := o.GetKeypairNameOk() + return ok } // SetKeypairName gets a reference to the given string and assigns it to the KeypairName field. -func (o *CreateServerPayload) SetKeypairName(v *string) { - o.KeypairName = v +func (o *CreateServerPayload) SetKeypairName(v CreateServerPayloadGetKeypairNameRetType) { + setCreateServerPayloadGetKeypairNameAttributeType(&o.KeypairName, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateServerPayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *CreateServerPayload) GetLabels() (res CreateServerPayloadGetLabelsRetType) { + 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 *CreateServerPayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *CreateServerPayload) GetLabelsOk() (ret CreateServerPayloadGetLabelsRetType, ok bool) { + return getCreateServerPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *CreateServerPayload) 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 *CreateServerPayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *CreateServerPayload) SetLabels(v CreateServerPayloadGetLabelsRetType) { + setCreateServerPayloadGetLabelsAttributeType(&o.Labels, v) } // GetLaunchedAt returns the LaunchedAt field value if set, zero value otherwise. -func (o *CreateServerPayload) GetLaunchedAt() *time.Time { - if o == nil || IsNil(o.LaunchedAt) { - var ret *time.Time - return ret - } - return o.LaunchedAt +func (o *CreateServerPayload) GetLaunchedAt() (res CreateServerPayloadGetLaunchedAtRetType) { + res, _ = o.GetLaunchedAtOk() + return } // GetLaunchedAtOk returns a tuple with the LaunchedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetLaunchedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.LaunchedAt) { - return nil, false - } - return o.LaunchedAt, true +func (o *CreateServerPayload) GetLaunchedAtOk() (ret CreateServerPayloadGetLaunchedAtRetType, ok bool) { + return getCreateServerPayloadGetLaunchedAtAttributeTypeOk(o.LaunchedAt) } // HasLaunchedAt returns a boolean if a field has been set. func (o *CreateServerPayload) HasLaunchedAt() bool { - if o != nil && !IsNil(o.LaunchedAt) { - return true - } - - return false + _, ok := o.GetLaunchedAtOk() + return ok } // SetLaunchedAt gets a reference to the given time.Time and assigns it to the LaunchedAt field. -func (o *CreateServerPayload) SetLaunchedAt(v *time.Time) { - o.LaunchedAt = v +func (o *CreateServerPayload) SetLaunchedAt(v CreateServerPayloadGetLaunchedAtRetType) { + setCreateServerPayloadGetLaunchedAtAttributeType(&o.LaunchedAt, v) } // GetMachineType returns the MachineType field value -func (o *CreateServerPayload) GetMachineType() *string { - if o == nil || IsNil(o.MachineType) { - var ret *string - return ret - } - - return o.MachineType +func (o *CreateServerPayload) GetMachineType() (ret CreateServerPayloadGetMachineTypeRetType) { + ret, _ = o.GetMachineTypeOk() + return ret } // GetMachineTypeOk returns a tuple with the MachineType field value // and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetMachineTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.MachineType, true +func (o *CreateServerPayload) GetMachineTypeOk() (ret CreateServerPayloadGetMachineTypeRetType, ok bool) { + return getCreateServerPayloadGetMachineTypeAttributeTypeOk(o.MachineType) } // SetMachineType sets field value -func (o *CreateServerPayload) SetMachineType(v *string) { - o.MachineType = v +func (o *CreateServerPayload) SetMachineType(v CreateServerPayloadGetMachineTypeRetType) { + setCreateServerPayloadGetMachineTypeAttributeType(&o.MachineType, v) } // GetMaintenanceWindow returns the MaintenanceWindow field value if set, zero value otherwise. -func (o *CreateServerPayload) GetMaintenanceWindow() *ServerMaintenance { - if o == nil || IsNil(o.MaintenanceWindow) { - var ret *ServerMaintenance - return ret - } - return o.MaintenanceWindow +func (o *CreateServerPayload) GetMaintenanceWindow() (res CreateServerPayloadGetMaintenanceWindowRetType) { + res, _ = o.GetMaintenanceWindowOk() + return } // GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetMaintenanceWindowOk() (*ServerMaintenance, bool) { - if o == nil || IsNil(o.MaintenanceWindow) { - return nil, false - } - return o.MaintenanceWindow, true +func (o *CreateServerPayload) GetMaintenanceWindowOk() (ret CreateServerPayloadGetMaintenanceWindowRetType, ok bool) { + return getCreateServerPayloadGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow) } // HasMaintenanceWindow returns a boolean if a field has been set. func (o *CreateServerPayload) HasMaintenanceWindow() bool { - if o != nil && !IsNil(o.MaintenanceWindow) { - return true - } - - return false + _, ok := o.GetMaintenanceWindowOk() + return ok } // SetMaintenanceWindow gets a reference to the given ServerMaintenance and assigns it to the MaintenanceWindow field. -func (o *CreateServerPayload) SetMaintenanceWindow(v *ServerMaintenance) { - o.MaintenanceWindow = v +func (o *CreateServerPayload) SetMaintenanceWindow(v CreateServerPayloadGetMaintenanceWindowRetType) { + setCreateServerPayloadGetMaintenanceWindowAttributeType(&o.MaintenanceWindow, v) } // GetName returns the Name field value -func (o *CreateServerPayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *CreateServerPayload) GetName() (ret CreateServerPayloadGetNameRetType) { + 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 *CreateServerPayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *CreateServerPayload) GetNameOk() (ret CreateServerPayloadGetNameRetType, ok bool) { + return getCreateServerPayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *CreateServerPayload) SetName(v *string) { - o.Name = v +func (o *CreateServerPayload) SetName(v CreateServerPayloadGetNameRetType) { + setCreateServerPayloadGetNameAttributeType(&o.Name, v) } // GetNetworking returns the Networking field value if set, zero value otherwise. -func (o *CreateServerPayload) GetNetworking() *CreateServerPayloadNetworking { - if o == nil || IsNil(o.Networking) { - var ret *CreateServerPayloadNetworking - return ret - } - return o.Networking +func (o *CreateServerPayload) GetNetworking() (res CreateServerPayloadGetNetworkingRetType) { + res, _ = o.GetNetworkingOk() + return } // GetNetworkingOk returns a tuple with the Networking field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetNetworkingOk() (*CreateServerPayloadNetworking, bool) { - if o == nil || IsNil(o.Networking) { - return nil, false - } - return o.Networking, true +func (o *CreateServerPayload) GetNetworkingOk() (ret CreateServerPayloadGetNetworkingRetType, ok bool) { + return getCreateServerPayloadGetNetworkingAttributeTypeOk(o.Networking) } // HasNetworking returns a boolean if a field has been set. func (o *CreateServerPayload) HasNetworking() bool { - if o != nil && !IsNil(o.Networking) { - return true - } - - return false + _, ok := o.GetNetworkingOk() + return ok } // SetNetworking gets a reference to the given CreateServerPayloadNetworking and assigns it to the Networking field. -func (o *CreateServerPayload) SetNetworking(v *CreateServerPayloadNetworking) { - o.Networking = v +func (o *CreateServerPayload) SetNetworking(v CreateServerPayloadGetNetworkingRetType) { + setCreateServerPayloadGetNetworkingAttributeType(&o.Networking, v) } // GetNics returns the Nics field value if set, zero value otherwise. -func (o *CreateServerPayload) GetNics() *[]ServerNetwork { - if o == nil || IsNil(o.Nics) { - var ret *[]ServerNetwork - return ret - } - return o.Nics +func (o *CreateServerPayload) GetNics() (res CreateServerPayloadGetNicsRetType) { + res, _ = o.GetNicsOk() + return } // GetNicsOk returns a tuple with the Nics field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetNicsOk() (*[]ServerNetwork, bool) { - if o == nil || IsNil(o.Nics) { - return nil, false - } - return o.Nics, true +func (o *CreateServerPayload) GetNicsOk() (ret CreateServerPayloadGetNicsRetType, ok bool) { + return getCreateServerPayloadGetNicsAttributeTypeOk(o.Nics) } // HasNics returns a boolean if a field has been set. func (o *CreateServerPayload) HasNics() bool { - if o != nil && !IsNil(o.Nics) { - return true - } - - return false + _, ok := o.GetNicsOk() + return ok } // SetNics gets a reference to the given []ServerNetwork and assigns it to the Nics field. -func (o *CreateServerPayload) SetNics(v *[]ServerNetwork) { - o.Nics = v +func (o *CreateServerPayload) SetNics(v CreateServerPayloadGetNicsRetType) { + setCreateServerPayloadGetNicsAttributeType(&o.Nics, v) } // GetPowerStatus returns the PowerStatus field value if set, zero value otherwise. -func (o *CreateServerPayload) GetPowerStatus() *string { - if o == nil || IsNil(o.PowerStatus) { - var ret *string - return ret - } - return o.PowerStatus +func (o *CreateServerPayload) GetPowerStatus() (res CreateServerPayloadGetPowerStatusRetType) { + res, _ = o.GetPowerStatusOk() + return } // GetPowerStatusOk returns a tuple with the PowerStatus field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetPowerStatusOk() (*string, bool) { - if o == nil || IsNil(o.PowerStatus) { - return nil, false - } - return o.PowerStatus, true +func (o *CreateServerPayload) GetPowerStatusOk() (ret CreateServerPayloadGetPowerStatusRetType, ok bool) { + return getCreateServerPayloadGetPowerStatusAttributeTypeOk(o.PowerStatus) } // HasPowerStatus returns a boolean if a field has been set. func (o *CreateServerPayload) HasPowerStatus() bool { - if o != nil && !IsNil(o.PowerStatus) { - return true - } - - return false + _, ok := o.GetPowerStatusOk() + return ok } // SetPowerStatus gets a reference to the given string and assigns it to the PowerStatus field. -func (o *CreateServerPayload) SetPowerStatus(v *string) { - o.PowerStatus = v +func (o *CreateServerPayload) SetPowerStatus(v CreateServerPayloadGetPowerStatusRetType) { + setCreateServerPayloadGetPowerStatusAttributeType(&o.PowerStatus, v) } // GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. -func (o *CreateServerPayload) GetSecurityGroups() *[]string { - if o == nil || IsNil(o.SecurityGroups) { - var ret *[]string - return ret - } - return o.SecurityGroups +func (o *CreateServerPayload) GetSecurityGroups() (res CreateServerPayloadGetSecurityGroupsRetType) { + res, _ = o.GetSecurityGroupsOk() + return } // GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetSecurityGroupsOk() (*[]string, bool) { - if o == nil || IsNil(o.SecurityGroups) { - return nil, false - } - return o.SecurityGroups, true +func (o *CreateServerPayload) GetSecurityGroupsOk() (ret CreateServerPayloadGetSecurityGroupsRetType, ok bool) { + return getCreateServerPayloadGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) } // HasSecurityGroups returns a boolean if a field has been set. func (o *CreateServerPayload) HasSecurityGroups() bool { - if o != nil && !IsNil(o.SecurityGroups) { - return true - } - - return false + _, ok := o.GetSecurityGroupsOk() + return ok } // SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. -func (o *CreateServerPayload) SetSecurityGroups(v *[]string) { - o.SecurityGroups = v +func (o *CreateServerPayload) SetSecurityGroups(v CreateServerPayloadGetSecurityGroupsRetType) { + setCreateServerPayloadGetSecurityGroupsAttributeType(&o.SecurityGroups, v) } // GetServiceAccountMails returns the ServiceAccountMails field value if set, zero value otherwise. -func (o *CreateServerPayload) GetServiceAccountMails() *[]string { - if o == nil || IsNil(o.ServiceAccountMails) { - var ret *[]string - return ret - } - return o.ServiceAccountMails +func (o *CreateServerPayload) GetServiceAccountMails() (res CreateServerPayloadGetServiceAccountMailsRetType) { + res, _ = o.GetServiceAccountMailsOk() + return } // GetServiceAccountMailsOk returns a tuple with the ServiceAccountMails field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetServiceAccountMailsOk() (*[]string, bool) { - if o == nil || IsNil(o.ServiceAccountMails) { - return nil, false - } - return o.ServiceAccountMails, true +func (o *CreateServerPayload) GetServiceAccountMailsOk() (ret CreateServerPayloadGetServiceAccountMailsRetType, ok bool) { + return getCreateServerPayloadGetServiceAccountMailsAttributeTypeOk(o.ServiceAccountMails) } // HasServiceAccountMails returns a boolean if a field has been set. func (o *CreateServerPayload) HasServiceAccountMails() bool { - if o != nil && !IsNil(o.ServiceAccountMails) { - return true - } - - return false + _, ok := o.GetServiceAccountMailsOk() + return ok } // SetServiceAccountMails gets a reference to the given []string and assigns it to the ServiceAccountMails field. -func (o *CreateServerPayload) SetServiceAccountMails(v *[]string) { - o.ServiceAccountMails = v +func (o *CreateServerPayload) SetServiceAccountMails(v CreateServerPayloadGetServiceAccountMailsRetType) { + setCreateServerPayloadGetServiceAccountMailsAttributeType(&o.ServiceAccountMails, v) } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *CreateServerPayload) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - return o.Status +func (o *CreateServerPayload) GetStatus() (res CreateServerPayloadGetStatusRetType) { + 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 *CreateServerPayload) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true +func (o *CreateServerPayload) GetStatusOk() (ret CreateServerPayloadGetStatusRetType, ok bool) { + return getCreateServerPayloadGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. func (o *CreateServerPayload) 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 *CreateServerPayload) SetStatus(v *string) { - o.Status = v +func (o *CreateServerPayload) SetStatus(v CreateServerPayloadGetStatusRetType) { + setCreateServerPayloadGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *CreateServerPayload) GetUpdatedAt() *time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret *time.Time - return ret - } - return o.UpdatedAt +func (o *CreateServerPayload) GetUpdatedAt() (res CreateServerPayloadGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true +func (o *CreateServerPayload) GetUpdatedAtOk() (ret CreateServerPayloadGetUpdatedAtRetType, ok bool) { + return getCreateServerPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. func (o *CreateServerPayload) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false + _, ok := o.GetUpdatedAtOk() + return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *CreateServerPayload) SetUpdatedAt(v *time.Time) { - o.UpdatedAt = v +func (o *CreateServerPayload) SetUpdatedAt(v CreateServerPayloadGetUpdatedAtRetType) { + setCreateServerPayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) } // GetUserData returns the UserData field value if set, zero value otherwise. -func (o *CreateServerPayload) GetUserData() *string { - if o == nil || IsNil(o.UserData) { - var ret *string - return ret - } - return o.UserData +func (o *CreateServerPayload) GetUserData() (res CreateServerPayloadGetUserDataRetType) { + res, _ = o.GetUserDataOk() + return } // GetUserDataOk returns a tuple with the UserData field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetUserDataOk() (*string, bool) { - if o == nil || IsNil(o.UserData) { - return nil, false - } - return o.UserData, true +func (o *CreateServerPayload) GetUserDataOk() (ret CreateServerPayloadGetUserDataRetType, ok bool) { + return getCreateServerPayloadGetUserDataAttributeTypeOk(o.UserData) } // HasUserData returns a boolean if a field has been set. func (o *CreateServerPayload) HasUserData() bool { - if o != nil && !IsNil(o.UserData) { - return true - } - - return false + _, ok := o.GetUserDataOk() + return ok } // SetUserData gets a reference to the given string and assigns it to the UserData field. -func (o *CreateServerPayload) SetUserData(v *string) { - o.UserData = v +func (o *CreateServerPayload) SetUserData(v CreateServerPayloadGetUserDataRetType) { + setCreateServerPayloadGetUserDataAttributeType(&o.UserData, v) } // GetVolumes returns the Volumes field value if set, zero value otherwise. -func (o *CreateServerPayload) GetVolumes() *[]string { - if o == nil || IsNil(o.Volumes) { - var ret *[]string - return ret - } - return o.Volumes +func (o *CreateServerPayload) GetVolumes() (res CreateServerPayloadGetVolumesRetType) { + res, _ = o.GetVolumesOk() + return } // GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetVolumesOk() (*[]string, bool) { - if o == nil || IsNil(o.Volumes) { - return nil, false - } - return o.Volumes, true +func (o *CreateServerPayload) GetVolumesOk() (ret CreateServerPayloadGetVolumesRetType, ok bool) { + return getCreateServerPayloadGetVolumesAttributeTypeOk(o.Volumes) } // HasVolumes returns a boolean if a field has been set. func (o *CreateServerPayload) HasVolumes() bool { - if o != nil && !IsNil(o.Volumes) { - return true - } - - return false + _, ok := o.GetVolumesOk() + return ok } // SetVolumes gets a reference to the given []string and assigns it to the Volumes field. -func (o *CreateServerPayload) SetVolumes(v *[]string) { - o.Volumes = v +func (o *CreateServerPayload) SetVolumes(v CreateServerPayloadGetVolumesRetType) { + setCreateServerPayloadGetVolumesAttributeType(&o.Volumes, v) } func (o CreateServerPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.AffinityGroup) { - toSerialize["affinityGroup"] = o.AffinityGroup + if val, ok := getCreateServerPayloadGetAffinityGroupAttributeTypeOk(o.AffinityGroup); ok { + toSerialize["AffinityGroup"] = val + } + if val, ok := getCreateServerPayloadGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { + toSerialize["AvailabilityZone"] = val + } + if val, ok := getCreateServerPayloadGetBootVolumeAttributeTypeOk(o.BootVolume); ok { + toSerialize["BootVolume"] = val } - if !IsNil(o.AvailabilityZone) { - toSerialize["availabilityZone"] = o.AvailabilityZone + if val, ok := getCreateServerPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val } - if !IsNil(o.BootVolume) { - toSerialize["bootVolume"] = o.BootVolume + if val, ok := getCreateServerPayloadGetErrorMessageAttributeTypeOk(o.ErrorMessage); ok { + toSerialize["ErrorMessage"] = val } - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt + if val, ok := getCreateServerPayloadGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.ErrorMessage) { - toSerialize["errorMessage"] = o.ErrorMessage + if val, ok := getCreateServerPayloadGetImageIdAttributeTypeOk(o.ImageId); ok { + toSerialize["ImageId"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getCreateServerPayloadGetKeypairNameAttributeTypeOk(o.KeypairName); ok { + toSerialize["KeypairName"] = val } - if !IsNil(o.ImageId) { - toSerialize["imageId"] = o.ImageId + if val, ok := getCreateServerPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.KeypairName) { - toSerialize["keypairName"] = o.KeypairName + if val, ok := getCreateServerPayloadGetLaunchedAtAttributeTypeOk(o.LaunchedAt); ok { + toSerialize["LaunchedAt"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getCreateServerPayloadGetMachineTypeAttributeTypeOk(o.MachineType); ok { + toSerialize["MachineType"] = val } - if !IsNil(o.LaunchedAt) { - toSerialize["launchedAt"] = o.LaunchedAt + if val, ok := getCreateServerPayloadGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow); ok { + toSerialize["MaintenanceWindow"] = val } - toSerialize["machineType"] = o.MachineType - if !IsNil(o.MaintenanceWindow) { - toSerialize["maintenanceWindow"] = o.MaintenanceWindow + if val, ok := getCreateServerPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - toSerialize["name"] = o.Name - if !IsNil(o.Networking) { - toSerialize["networking"] = o.Networking + if val, ok := getCreateServerPayloadGetNetworkingAttributeTypeOk(o.Networking); ok { + toSerialize["Networking"] = val } - if !IsNil(o.Nics) { - toSerialize["nics"] = o.Nics + if val, ok := getCreateServerPayloadGetNicsAttributeTypeOk(o.Nics); ok { + toSerialize["Nics"] = val } - if !IsNil(o.PowerStatus) { - toSerialize["powerStatus"] = o.PowerStatus + if val, ok := getCreateServerPayloadGetPowerStatusAttributeTypeOk(o.PowerStatus); ok { + toSerialize["PowerStatus"] = val } - if !IsNil(o.SecurityGroups) { - toSerialize["securityGroups"] = o.SecurityGroups + if val, ok := getCreateServerPayloadGetSecurityGroupsAttributeTypeOk(o.SecurityGroups); ok { + toSerialize["SecurityGroups"] = val } - if !IsNil(o.ServiceAccountMails) { - toSerialize["serviceAccountMails"] = o.ServiceAccountMails + if val, ok := getCreateServerPayloadGetServiceAccountMailsAttributeTypeOk(o.ServiceAccountMails); ok { + toSerialize["ServiceAccountMails"] = val } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status + if val, ok := getCreateServerPayloadGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt + if val, ok := getCreateServerPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val } - if !IsNil(o.UserData) { - toSerialize["userData"] = o.UserData + if val, ok := getCreateServerPayloadGetUserDataAttributeTypeOk(o.UserData); ok { + toSerialize["UserData"] = val } - if !IsNil(o.Volumes) { - toSerialize["volumes"] = o.Volumes + if val, ok := getCreateServerPayloadGetVolumesAttributeTypeOk(o.Volumes); ok { + toSerialize["Volumes"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_server_payload_boot_volume.go b/services/iaas/model_create_server_payload_boot_volume.go index ace4dceb1..707746547 100644 --- a/services/iaas/model_create_server_payload_boot_volume.go +++ b/services/iaas/model_create_server_payload_boot_volume.go @@ -17,17 +17,119 @@ import ( // checks if the CreateServerPayloadBootVolume type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateServerPayloadBootVolume{} +/* + types and functions for deleteOnTermination +*/ + +// isBoolean +type CreateServerPayloadBootVolumegetDeleteOnTerminationAttributeType = *bool +type CreateServerPayloadBootVolumegetDeleteOnTerminationArgType = bool +type CreateServerPayloadBootVolumegetDeleteOnTerminationRetType = bool + +func getCreateServerPayloadBootVolumegetDeleteOnTerminationAttributeTypeOk(arg CreateServerPayloadBootVolumegetDeleteOnTerminationAttributeType) (ret CreateServerPayloadBootVolumegetDeleteOnTerminationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadBootVolumegetDeleteOnTerminationAttributeType(arg *CreateServerPayloadBootVolumegetDeleteOnTerminationAttributeType, val CreateServerPayloadBootVolumegetDeleteOnTerminationRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type CreateServerPayloadBootVolumeGetIdAttributeType = *string + +func getCreateServerPayloadBootVolumeGetIdAttributeTypeOk(arg CreateServerPayloadBootVolumeGetIdAttributeType) (ret CreateServerPayloadBootVolumeGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadBootVolumeGetIdAttributeType(arg *CreateServerPayloadBootVolumeGetIdAttributeType, val CreateServerPayloadBootVolumeGetIdRetType) { + *arg = &val +} + +type CreateServerPayloadBootVolumeGetIdArgType = string +type CreateServerPayloadBootVolumeGetIdRetType = string + +/* + types and functions for performanceClass +*/ + +// isNotNullableString +type CreateServerPayloadBootVolumeGetPerformanceClassAttributeType = *string + +func getCreateServerPayloadBootVolumeGetPerformanceClassAttributeTypeOk(arg CreateServerPayloadBootVolumeGetPerformanceClassAttributeType) (ret CreateServerPayloadBootVolumeGetPerformanceClassRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadBootVolumeGetPerformanceClassAttributeType(arg *CreateServerPayloadBootVolumeGetPerformanceClassAttributeType, val CreateServerPayloadBootVolumeGetPerformanceClassRetType) { + *arg = &val +} + +type CreateServerPayloadBootVolumeGetPerformanceClassArgType = string +type CreateServerPayloadBootVolumeGetPerformanceClassRetType = string + +/* + types and functions for size +*/ + +// isLong +type CreateServerPayloadBootVolumeGetSizeAttributeType = *int64 +type CreateServerPayloadBootVolumeGetSizeArgType = int64 +type CreateServerPayloadBootVolumeGetSizeRetType = int64 + +func getCreateServerPayloadBootVolumeGetSizeAttributeTypeOk(arg CreateServerPayloadBootVolumeGetSizeAttributeType) (ret CreateServerPayloadBootVolumeGetSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadBootVolumeGetSizeAttributeType(arg *CreateServerPayloadBootVolumeGetSizeAttributeType, val CreateServerPayloadBootVolumeGetSizeRetType) { + *arg = &val +} + +/* + types and functions for source +*/ + +// isModel +type CreateServerPayloadBootVolumeGetSourceAttributeType = *BootVolumeSource +type CreateServerPayloadBootVolumeGetSourceArgType = BootVolumeSource +type CreateServerPayloadBootVolumeGetSourceRetType = BootVolumeSource + +func getCreateServerPayloadBootVolumeGetSourceAttributeTypeOk(arg CreateServerPayloadBootVolumeGetSourceAttributeType) (ret CreateServerPayloadBootVolumeGetSourceRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadBootVolumeGetSourceAttributeType(arg *CreateServerPayloadBootVolumeGetSourceAttributeType, val CreateServerPayloadBootVolumeGetSourceRetType) { + *arg = &val +} + // CreateServerPayloadBootVolume struct for CreateServerPayloadBootVolume type CreateServerPayloadBootVolume struct { // Delete the volume during the termination of the server. Defaults to false. - DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` + DeleteOnTermination CreateServerPayloadBootVolumegetDeleteOnTerminationAttributeType `json:"deleteOnTermination,omitempty"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id CreateServerPayloadBootVolumeGetIdAttributeType `json:"id,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - PerformanceClass *string `json:"performanceClass,omitempty"` + PerformanceClass CreateServerPayloadBootVolumeGetPerformanceClassAttributeType `json:"performanceClass,omitempty"` // Size in Gigabyte. - Size *int64 `json:"size,omitempty"` - Source *BootVolumeSource `json:"source,omitempty"` + Size CreateServerPayloadBootVolumeGetSizeAttributeType `json:"size,omitempty"` + Source CreateServerPayloadBootVolumeGetSourceAttributeType `json:"source,omitempty"` } // NewCreateServerPayloadBootVolume instantiates a new CreateServerPayloadBootVolume object @@ -48,181 +150,136 @@ func NewCreateServerPayloadBootVolumeWithDefaults() *CreateServerPayloadBootVolu } // GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. -func (o *CreateServerPayloadBootVolume) GetDeleteOnTermination() *bool { - if o == nil || IsNil(o.DeleteOnTermination) { - var ret *bool - return ret - } - return o.DeleteOnTermination +func (o *CreateServerPayloadBootVolume) GetDeleteOnTermination() (res CreateServerPayloadBootVolumegetDeleteOnTerminationRetType) { + res, _ = o.GetDeleteOnTerminationOk() + return } // GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayloadBootVolume) GetDeleteOnTerminationOk() (*bool, bool) { - if o == nil || IsNil(o.DeleteOnTermination) { - return nil, false - } - return o.DeleteOnTermination, true +func (o *CreateServerPayloadBootVolume) GetDeleteOnTerminationOk() (ret CreateServerPayloadBootVolumegetDeleteOnTerminationRetType, ok bool) { + return getCreateServerPayloadBootVolumegetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination) } // HasDeleteOnTermination returns a boolean if a field has been set. func (o *CreateServerPayloadBootVolume) HasDeleteOnTermination() bool { - if o != nil && !IsNil(o.DeleteOnTermination) { - return true - } - - return false + _, ok := o.GetDeleteOnTerminationOk() + return ok } // SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. -func (o *CreateServerPayloadBootVolume) SetDeleteOnTermination(v *bool) { - o.DeleteOnTermination = v +func (o *CreateServerPayloadBootVolume) SetDeleteOnTermination(v CreateServerPayloadBootVolumegetDeleteOnTerminationRetType) { + setCreateServerPayloadBootVolumegetDeleteOnTerminationAttributeType(&o.DeleteOnTermination, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *CreateServerPayloadBootVolume) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *CreateServerPayloadBootVolume) GetId() (res CreateServerPayloadBootVolumeGetIdRetType) { + 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 *CreateServerPayloadBootVolume) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *CreateServerPayloadBootVolume) GetIdOk() (ret CreateServerPayloadBootVolumeGetIdRetType, ok bool) { + return getCreateServerPayloadBootVolumeGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *CreateServerPayloadBootVolume) 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 *CreateServerPayloadBootVolume) SetId(v *string) { - o.Id = v +func (o *CreateServerPayloadBootVolume) SetId(v CreateServerPayloadBootVolumeGetIdRetType) { + setCreateServerPayloadBootVolumeGetIdAttributeType(&o.Id, v) } // GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. -func (o *CreateServerPayloadBootVolume) GetPerformanceClass() *string { - if o == nil || IsNil(o.PerformanceClass) { - var ret *string - return ret - } - return o.PerformanceClass +func (o *CreateServerPayloadBootVolume) GetPerformanceClass() (res CreateServerPayloadBootVolumeGetPerformanceClassRetType) { + res, _ = o.GetPerformanceClassOk() + return } // GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayloadBootVolume) GetPerformanceClassOk() (*string, bool) { - if o == nil || IsNil(o.PerformanceClass) { - return nil, false - } - return o.PerformanceClass, true +func (o *CreateServerPayloadBootVolume) GetPerformanceClassOk() (ret CreateServerPayloadBootVolumeGetPerformanceClassRetType, ok bool) { + return getCreateServerPayloadBootVolumeGetPerformanceClassAttributeTypeOk(o.PerformanceClass) } // HasPerformanceClass returns a boolean if a field has been set. func (o *CreateServerPayloadBootVolume) HasPerformanceClass() bool { - if o != nil && !IsNil(o.PerformanceClass) { - return true - } - - return false + _, ok := o.GetPerformanceClassOk() + return ok } // SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. -func (o *CreateServerPayloadBootVolume) SetPerformanceClass(v *string) { - o.PerformanceClass = v +func (o *CreateServerPayloadBootVolume) SetPerformanceClass(v CreateServerPayloadBootVolumeGetPerformanceClassRetType) { + setCreateServerPayloadBootVolumeGetPerformanceClassAttributeType(&o.PerformanceClass, v) } // GetSize returns the Size field value if set, zero value otherwise. -func (o *CreateServerPayloadBootVolume) GetSize() *int64 { - if o == nil || IsNil(o.Size) { - var ret *int64 - return ret - } - return o.Size +func (o *CreateServerPayloadBootVolume) GetSize() (res CreateServerPayloadBootVolumeGetSizeRetType) { + 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 *CreateServerPayloadBootVolume) GetSizeOk() (*int64, bool) { - if o == nil || IsNil(o.Size) { - return nil, false - } - return o.Size, true +func (o *CreateServerPayloadBootVolume) GetSizeOk() (ret CreateServerPayloadBootVolumeGetSizeRetType, ok bool) { + return getCreateServerPayloadBootVolumeGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. func (o *CreateServerPayloadBootVolume) 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 *CreateServerPayloadBootVolume) SetSize(v *int64) { - o.Size = v +func (o *CreateServerPayloadBootVolume) SetSize(v CreateServerPayloadBootVolumeGetSizeRetType) { + setCreateServerPayloadBootVolumeGetSizeAttributeType(&o.Size, v) } // GetSource returns the Source field value if set, zero value otherwise. -func (o *CreateServerPayloadBootVolume) GetSource() *BootVolumeSource { - if o == nil || IsNil(o.Source) { - var ret *BootVolumeSource - return ret - } - return o.Source +func (o *CreateServerPayloadBootVolume) GetSource() (res CreateServerPayloadBootVolumeGetSourceRetType) { + res, _ = o.GetSourceOk() + return } // GetSourceOk returns a tuple with the Source field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateServerPayloadBootVolume) GetSourceOk() (*BootVolumeSource, bool) { - if o == nil || IsNil(o.Source) { - return nil, false - } - return o.Source, true +func (o *CreateServerPayloadBootVolume) GetSourceOk() (ret CreateServerPayloadBootVolumeGetSourceRetType, ok bool) { + return getCreateServerPayloadBootVolumeGetSourceAttributeTypeOk(o.Source) } // HasSource returns a boolean if a field has been set. func (o *CreateServerPayloadBootVolume) HasSource() bool { - if o != nil && !IsNil(o.Source) { - return true - } - - return false + _, ok := o.GetSourceOk() + return ok } // SetSource gets a reference to the given BootVolumeSource and assigns it to the Source field. -func (o *CreateServerPayloadBootVolume) SetSource(v *BootVolumeSource) { - o.Source = v +func (o *CreateServerPayloadBootVolume) SetSource(v CreateServerPayloadBootVolumeGetSourceRetType) { + setCreateServerPayloadBootVolumeGetSourceAttributeType(&o.Source, v) } func (o CreateServerPayloadBootVolume) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.DeleteOnTermination) { - toSerialize["deleteOnTermination"] = o.DeleteOnTermination + if val, ok := getCreateServerPayloadBootVolumegetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination); ok { + toSerialize["DeleteOnTermination"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getCreateServerPayloadBootVolumeGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.PerformanceClass) { - toSerialize["performanceClass"] = o.PerformanceClass + if val, ok := getCreateServerPayloadBootVolumeGetPerformanceClassAttributeTypeOk(o.PerformanceClass); ok { + toSerialize["PerformanceClass"] = val } - if !IsNil(o.Size) { - toSerialize["size"] = o.Size + if val, ok := getCreateServerPayloadBootVolumeGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val } - if !IsNil(o.Source) { - toSerialize["source"] = o.Source + if val, ok := getCreateServerPayloadBootVolumeGetSourceAttributeTypeOk(o.Source); ok { + toSerialize["Source"] = val } return toSerialize, nil } diff --git a/services/iaas/model_create_snapshot_payload.go b/services/iaas/model_create_snapshot_payload.go index f361f0340..de8e8f954 100644 --- a/services/iaas/model_create_snapshot_payload.go +++ b/services/iaas/model_create_snapshot_payload.go @@ -18,25 +18,189 @@ import ( // checks if the CreateSnapshotPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateSnapshotPayload{} +/* + types and functions for createdAt +*/ + +// isDateTime +type CreateSnapshotPayloadGetCreatedAtAttributeType = *time.Time +type CreateSnapshotPayloadGetCreatedAtArgType = time.Time +type CreateSnapshotPayloadGetCreatedAtRetType = time.Time + +func getCreateSnapshotPayloadGetCreatedAtAttributeTypeOk(arg CreateSnapshotPayloadGetCreatedAtAttributeType) (ret CreateSnapshotPayloadGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSnapshotPayloadGetCreatedAtAttributeType(arg *CreateSnapshotPayloadGetCreatedAtAttributeType, val CreateSnapshotPayloadGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type CreateSnapshotPayloadGetIdAttributeType = *string + +func getCreateSnapshotPayloadGetIdAttributeTypeOk(arg CreateSnapshotPayloadGetIdAttributeType) (ret CreateSnapshotPayloadGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSnapshotPayloadGetIdAttributeType(arg *CreateSnapshotPayloadGetIdAttributeType, val CreateSnapshotPayloadGetIdRetType) { + *arg = &val +} + +type CreateSnapshotPayloadGetIdArgType = string +type CreateSnapshotPayloadGetIdRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type CreateSnapshotPayloadGetLabelsAttributeType = *map[string]interface{} +type CreateSnapshotPayloadGetLabelsArgType = map[string]interface{} +type CreateSnapshotPayloadGetLabelsRetType = map[string]interface{} + +func getCreateSnapshotPayloadGetLabelsAttributeTypeOk(arg CreateSnapshotPayloadGetLabelsAttributeType) (ret CreateSnapshotPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSnapshotPayloadGetLabelsAttributeType(arg *CreateSnapshotPayloadGetLabelsAttributeType, val CreateSnapshotPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateSnapshotPayloadGetNameAttributeType = *string + +func getCreateSnapshotPayloadGetNameAttributeTypeOk(arg CreateSnapshotPayloadGetNameAttributeType) (ret CreateSnapshotPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSnapshotPayloadGetNameAttributeType(arg *CreateSnapshotPayloadGetNameAttributeType, val CreateSnapshotPayloadGetNameRetType) { + *arg = &val +} + +type CreateSnapshotPayloadGetNameArgType = string +type CreateSnapshotPayloadGetNameRetType = string + +/* + types and functions for size +*/ + +// isLong +type CreateSnapshotPayloadGetSizeAttributeType = *int64 +type CreateSnapshotPayloadGetSizeArgType = int64 +type CreateSnapshotPayloadGetSizeRetType = int64 + +func getCreateSnapshotPayloadGetSizeAttributeTypeOk(arg CreateSnapshotPayloadGetSizeAttributeType) (ret CreateSnapshotPayloadGetSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSnapshotPayloadGetSizeAttributeType(arg *CreateSnapshotPayloadGetSizeAttributeType, val CreateSnapshotPayloadGetSizeRetType) { + *arg = &val +} + +/* + types and functions for status +*/ + +// isNotNullableString +type CreateSnapshotPayloadGetStatusAttributeType = *string + +func getCreateSnapshotPayloadGetStatusAttributeTypeOk(arg CreateSnapshotPayloadGetStatusAttributeType) (ret CreateSnapshotPayloadGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSnapshotPayloadGetStatusAttributeType(arg *CreateSnapshotPayloadGetStatusAttributeType, val CreateSnapshotPayloadGetStatusRetType) { + *arg = &val +} + +type CreateSnapshotPayloadGetStatusArgType = string +type CreateSnapshotPayloadGetStatusRetType = string + +/* + types and functions for updatedAt +*/ + +// isDateTime +type CreateSnapshotPayloadGetUpdatedAtAttributeType = *time.Time +type CreateSnapshotPayloadGetUpdatedAtArgType = time.Time +type CreateSnapshotPayloadGetUpdatedAtRetType = time.Time + +func getCreateSnapshotPayloadGetUpdatedAtAttributeTypeOk(arg CreateSnapshotPayloadGetUpdatedAtAttributeType) (ret CreateSnapshotPayloadGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSnapshotPayloadGetUpdatedAtAttributeType(arg *CreateSnapshotPayloadGetUpdatedAtAttributeType, val CreateSnapshotPayloadGetUpdatedAtRetType) { + *arg = &val +} + +/* + types and functions for volumeId +*/ + +// isNotNullableString +type CreateSnapshotPayloadGetVolumeIdAttributeType = *string + +func getCreateSnapshotPayloadGetVolumeIdAttributeTypeOk(arg CreateSnapshotPayloadGetVolumeIdAttributeType) (ret CreateSnapshotPayloadGetVolumeIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateSnapshotPayloadGetVolumeIdAttributeType(arg *CreateSnapshotPayloadGetVolumeIdAttributeType, val CreateSnapshotPayloadGetVolumeIdRetType) { + *arg = &val +} + +type CreateSnapshotPayloadGetVolumeIdArgType = string +type CreateSnapshotPayloadGetVolumeIdRetType = string + // CreateSnapshotPayload Object that represents a snapshot. type CreateSnapshotPayload struct { // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt CreateSnapshotPayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id CreateSnapshotPayloadGetIdAttributeType `json:"id,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels CreateSnapshotPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty"` + Name CreateSnapshotPayloadGetNameAttributeType `json:"name,omitempty"` // Size in Gigabyte. - Size *int64 `json:"size,omitempty"` + Size CreateSnapshotPayloadGetSizeAttributeType `json:"size,omitempty"` // The status of a snapshot object. Possible values: `AVAILABLE`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`, `UNMANAGING`, `UPDATING`. - Status *string `json:"status,omitempty"` + Status CreateSnapshotPayloadGetStatusAttributeType `json:"status,omitempty"` // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAt CreateSnapshotPayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` // Universally Unique Identifier (UUID). // REQUIRED - VolumeId *string `json:"volumeId"` + VolumeId CreateSnapshotPayloadGetVolumeIdAttributeType `json:"volumeId"` } type _CreateSnapshotPayload CreateSnapshotPayload @@ -45,9 +209,9 @@ type _CreateSnapshotPayload CreateSnapshotPayload // 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 NewCreateSnapshotPayload(volumeId *string) *CreateSnapshotPayload { +func NewCreateSnapshotPayload(volumeId CreateSnapshotPayloadGetVolumeIdArgType) *CreateSnapshotPayload { this := CreateSnapshotPayload{} - this.VolumeId = volumeId + setCreateSnapshotPayloadGetVolumeIdAttributeType(&this.VolumeId, volumeId) return &this } @@ -60,277 +224,209 @@ func NewCreateSnapshotPayloadWithDefaults() *CreateSnapshotPayload { } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *CreateSnapshotPayload) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - return o.CreatedAt +func (o *CreateSnapshotPayload) GetCreatedAt() (res CreateSnapshotPayloadGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return } // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateSnapshotPayload) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true +func (o *CreateSnapshotPayload) GetCreatedAtOk() (ret CreateSnapshotPayloadGetCreatedAtRetType, ok bool) { + return getCreateSnapshotPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. func (o *CreateSnapshotPayload) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false + _, ok := o.GetCreatedAtOk() + return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *CreateSnapshotPayload) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *CreateSnapshotPayload) SetCreatedAt(v CreateSnapshotPayloadGetCreatedAtRetType) { + setCreateSnapshotPayloadGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *CreateSnapshotPayload) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *CreateSnapshotPayload) GetId() (res CreateSnapshotPayloadGetIdRetType) { + 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 *CreateSnapshotPayload) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *CreateSnapshotPayload) GetIdOk() (ret CreateSnapshotPayloadGetIdRetType, ok bool) { + return getCreateSnapshotPayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *CreateSnapshotPayload) 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 *CreateSnapshotPayload) SetId(v *string) { - o.Id = v +func (o *CreateSnapshotPayload) SetId(v CreateSnapshotPayloadGetIdRetType) { + setCreateSnapshotPayloadGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateSnapshotPayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *CreateSnapshotPayload) GetLabels() (res CreateSnapshotPayloadGetLabelsRetType) { + 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 *CreateSnapshotPayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *CreateSnapshotPayload) GetLabelsOk() (ret CreateSnapshotPayloadGetLabelsRetType, ok bool) { + return getCreateSnapshotPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *CreateSnapshotPayload) 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 *CreateSnapshotPayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *CreateSnapshotPayload) SetLabels(v CreateSnapshotPayloadGetLabelsRetType) { + setCreateSnapshotPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *CreateSnapshotPayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *CreateSnapshotPayload) GetName() (res CreateSnapshotPayloadGetNameRetType) { + 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 *CreateSnapshotPayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *CreateSnapshotPayload) GetNameOk() (ret CreateSnapshotPayloadGetNameRetType, ok bool) { + return getCreateSnapshotPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *CreateSnapshotPayload) 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 *CreateSnapshotPayload) SetName(v *string) { - o.Name = v +func (o *CreateSnapshotPayload) SetName(v CreateSnapshotPayloadGetNameRetType) { + setCreateSnapshotPayloadGetNameAttributeType(&o.Name, v) } // GetSize returns the Size field value if set, zero value otherwise. -func (o *CreateSnapshotPayload) GetSize() *int64 { - if o == nil || IsNil(o.Size) { - var ret *int64 - return ret - } - return o.Size +func (o *CreateSnapshotPayload) GetSize() (res CreateSnapshotPayloadGetSizeRetType) { + 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 *CreateSnapshotPayload) GetSizeOk() (*int64, bool) { - if o == nil || IsNil(o.Size) { - return nil, false - } - return o.Size, true +func (o *CreateSnapshotPayload) GetSizeOk() (ret CreateSnapshotPayloadGetSizeRetType, ok bool) { + return getCreateSnapshotPayloadGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. func (o *CreateSnapshotPayload) 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 *CreateSnapshotPayload) SetSize(v *int64) { - o.Size = v +func (o *CreateSnapshotPayload) SetSize(v CreateSnapshotPayloadGetSizeRetType) { + setCreateSnapshotPayloadGetSizeAttributeType(&o.Size, v) } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *CreateSnapshotPayload) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - return o.Status +func (o *CreateSnapshotPayload) GetStatus() (res CreateSnapshotPayloadGetStatusRetType) { + 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 *CreateSnapshotPayload) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true +func (o *CreateSnapshotPayload) GetStatusOk() (ret CreateSnapshotPayloadGetStatusRetType, ok bool) { + return getCreateSnapshotPayloadGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. func (o *CreateSnapshotPayload) 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 *CreateSnapshotPayload) SetStatus(v *string) { - o.Status = v +func (o *CreateSnapshotPayload) SetStatus(v CreateSnapshotPayloadGetStatusRetType) { + setCreateSnapshotPayloadGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *CreateSnapshotPayload) GetUpdatedAt() *time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret *time.Time - return ret - } - return o.UpdatedAt +func (o *CreateSnapshotPayload) GetUpdatedAt() (res CreateSnapshotPayloadGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateSnapshotPayload) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true +func (o *CreateSnapshotPayload) GetUpdatedAtOk() (ret CreateSnapshotPayloadGetUpdatedAtRetType, ok bool) { + return getCreateSnapshotPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. func (o *CreateSnapshotPayload) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false + _, ok := o.GetUpdatedAtOk() + return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *CreateSnapshotPayload) SetUpdatedAt(v *time.Time) { - o.UpdatedAt = v +func (o *CreateSnapshotPayload) SetUpdatedAt(v CreateSnapshotPayloadGetUpdatedAtRetType) { + setCreateSnapshotPayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) } // GetVolumeId returns the VolumeId field value -func (o *CreateSnapshotPayload) GetVolumeId() *string { - if o == nil || IsNil(o.VolumeId) { - var ret *string - return ret - } - - return o.VolumeId +func (o *CreateSnapshotPayload) GetVolumeId() (ret CreateSnapshotPayloadGetVolumeIdRetType) { + ret, _ = o.GetVolumeIdOk() + return ret } // GetVolumeIdOk returns a tuple with the VolumeId field value // and a boolean to check if the value has been set. -func (o *CreateSnapshotPayload) GetVolumeIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.VolumeId, true +func (o *CreateSnapshotPayload) GetVolumeIdOk() (ret CreateSnapshotPayloadGetVolumeIdRetType, ok bool) { + return getCreateSnapshotPayloadGetVolumeIdAttributeTypeOk(o.VolumeId) } // SetVolumeId sets field value -func (o *CreateSnapshotPayload) SetVolumeId(v *string) { - o.VolumeId = v +func (o *CreateSnapshotPayload) SetVolumeId(v CreateSnapshotPayloadGetVolumeIdRetType) { + setCreateSnapshotPayloadGetVolumeIdAttributeType(&o.VolumeId, v) } func (o CreateSnapshotPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt + if val, ok := getCreateSnapshotPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getCreateSnapshotPayloadGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getCreateSnapshotPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getCreateSnapshotPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getCreateSnapshotPayloadGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val } - if !IsNil(o.Size) { - toSerialize["size"] = o.Size + if val, ok := getCreateSnapshotPayloadGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status + if val, ok := getCreateSnapshotPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt + if val, ok := getCreateSnapshotPayloadGetVolumeIdAttributeTypeOk(o.VolumeId); ok { + toSerialize["VolumeId"] = val } - toSerialize["volumeId"] = o.VolumeId return toSerialize, nil } diff --git a/services/iaas/model_create_volume_payload.go b/services/iaas/model_create_volume_payload.go index 6c8238c21..48351cb99 100644 --- a/services/iaas/model_create_volume_payload.go +++ b/services/iaas/model_create_volume_payload.go @@ -18,35 +18,322 @@ import ( // checks if the CreateVolumePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateVolumePayload{} +/* + types and functions for availabilityZone +*/ + +// isNotNullableString +type CreateVolumePayloadGetAvailabilityZoneAttributeType = *string + +func getCreateVolumePayloadGetAvailabilityZoneAttributeTypeOk(arg CreateVolumePayloadGetAvailabilityZoneAttributeType) (ret CreateVolumePayloadGetAvailabilityZoneRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateVolumePayloadGetAvailabilityZoneAttributeType(arg *CreateVolumePayloadGetAvailabilityZoneAttributeType, val CreateVolumePayloadGetAvailabilityZoneRetType) { + *arg = &val +} + +type CreateVolumePayloadGetAvailabilityZoneArgType = string +type CreateVolumePayloadGetAvailabilityZoneRetType = string + +/* + types and functions for bootable +*/ + +// isBoolean +type CreateVolumePayloadgetBootableAttributeType = *bool +type CreateVolumePayloadgetBootableArgType = bool +type CreateVolumePayloadgetBootableRetType = bool + +func getCreateVolumePayloadgetBootableAttributeTypeOk(arg CreateVolumePayloadgetBootableAttributeType) (ret CreateVolumePayloadgetBootableRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateVolumePayloadgetBootableAttributeType(arg *CreateVolumePayloadgetBootableAttributeType, val CreateVolumePayloadgetBootableRetType) { + *arg = &val +} + +/* + types and functions for createdAt +*/ + +// isDateTime +type CreateVolumePayloadGetCreatedAtAttributeType = *time.Time +type CreateVolumePayloadGetCreatedAtArgType = time.Time +type CreateVolumePayloadGetCreatedAtRetType = time.Time + +func getCreateVolumePayloadGetCreatedAtAttributeTypeOk(arg CreateVolumePayloadGetCreatedAtAttributeType) (ret CreateVolumePayloadGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateVolumePayloadGetCreatedAtAttributeType(arg *CreateVolumePayloadGetCreatedAtAttributeType, val CreateVolumePayloadGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for description +*/ + +// isNotNullableString +type CreateVolumePayloadGetDescriptionAttributeType = *string + +func getCreateVolumePayloadGetDescriptionAttributeTypeOk(arg CreateVolumePayloadGetDescriptionAttributeType) (ret CreateVolumePayloadGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateVolumePayloadGetDescriptionAttributeType(arg *CreateVolumePayloadGetDescriptionAttributeType, val CreateVolumePayloadGetDescriptionRetType) { + *arg = &val +} + +type CreateVolumePayloadGetDescriptionArgType = string +type CreateVolumePayloadGetDescriptionRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type CreateVolumePayloadGetIdAttributeType = *string + +func getCreateVolumePayloadGetIdAttributeTypeOk(arg CreateVolumePayloadGetIdAttributeType) (ret CreateVolumePayloadGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateVolumePayloadGetIdAttributeType(arg *CreateVolumePayloadGetIdAttributeType, val CreateVolumePayloadGetIdRetType) { + *arg = &val +} + +type CreateVolumePayloadGetIdArgType = string +type CreateVolumePayloadGetIdRetType = string + +/* + types and functions for imageConfig +*/ + +// isModel +type CreateVolumePayloadGetImageConfigAttributeType = *ImageConfig +type CreateVolumePayloadGetImageConfigArgType = ImageConfig +type CreateVolumePayloadGetImageConfigRetType = ImageConfig + +func getCreateVolumePayloadGetImageConfigAttributeTypeOk(arg CreateVolumePayloadGetImageConfigAttributeType) (ret CreateVolumePayloadGetImageConfigRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateVolumePayloadGetImageConfigAttributeType(arg *CreateVolumePayloadGetImageConfigAttributeType, val CreateVolumePayloadGetImageConfigRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isFreeform +type CreateVolumePayloadGetLabelsAttributeType = *map[string]interface{} +type CreateVolumePayloadGetLabelsArgType = map[string]interface{} +type CreateVolumePayloadGetLabelsRetType = map[string]interface{} + +func getCreateVolumePayloadGetLabelsAttributeTypeOk(arg CreateVolumePayloadGetLabelsAttributeType) (ret CreateVolumePayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateVolumePayloadGetLabelsAttributeType(arg *CreateVolumePayloadGetLabelsAttributeType, val CreateVolumePayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateVolumePayloadGetNameAttributeType = *string + +func getCreateVolumePayloadGetNameAttributeTypeOk(arg CreateVolumePayloadGetNameAttributeType) (ret CreateVolumePayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateVolumePayloadGetNameAttributeType(arg *CreateVolumePayloadGetNameAttributeType, val CreateVolumePayloadGetNameRetType) { + *arg = &val +} + +type CreateVolumePayloadGetNameArgType = string +type CreateVolumePayloadGetNameRetType = string + +/* + types and functions for performanceClass +*/ + +// isNotNullableString +type CreateVolumePayloadGetPerformanceClassAttributeType = *string + +func getCreateVolumePayloadGetPerformanceClassAttributeTypeOk(arg CreateVolumePayloadGetPerformanceClassAttributeType) (ret CreateVolumePayloadGetPerformanceClassRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateVolumePayloadGetPerformanceClassAttributeType(arg *CreateVolumePayloadGetPerformanceClassAttributeType, val CreateVolumePayloadGetPerformanceClassRetType) { + *arg = &val +} + +type CreateVolumePayloadGetPerformanceClassArgType = string +type CreateVolumePayloadGetPerformanceClassRetType = string + +/* + types and functions for serverId +*/ + +// isNotNullableString +type CreateVolumePayloadGetServerIdAttributeType = *string + +func getCreateVolumePayloadGetServerIdAttributeTypeOk(arg CreateVolumePayloadGetServerIdAttributeType) (ret CreateVolumePayloadGetServerIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateVolumePayloadGetServerIdAttributeType(arg *CreateVolumePayloadGetServerIdAttributeType, val CreateVolumePayloadGetServerIdRetType) { + *arg = &val +} + +type CreateVolumePayloadGetServerIdArgType = string +type CreateVolumePayloadGetServerIdRetType = string + +/* + types and functions for size +*/ + +// isLong +type CreateVolumePayloadGetSizeAttributeType = *int64 +type CreateVolumePayloadGetSizeArgType = int64 +type CreateVolumePayloadGetSizeRetType = int64 + +func getCreateVolumePayloadGetSizeAttributeTypeOk(arg CreateVolumePayloadGetSizeAttributeType) (ret CreateVolumePayloadGetSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateVolumePayloadGetSizeAttributeType(arg *CreateVolumePayloadGetSizeAttributeType, val CreateVolumePayloadGetSizeRetType) { + *arg = &val +} + +/* + types and functions for source +*/ + +// isModel +type CreateVolumePayloadGetSourceAttributeType = *VolumeSource +type CreateVolumePayloadGetSourceArgType = VolumeSource +type CreateVolumePayloadGetSourceRetType = VolumeSource + +func getCreateVolumePayloadGetSourceAttributeTypeOk(arg CreateVolumePayloadGetSourceAttributeType) (ret CreateVolumePayloadGetSourceRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateVolumePayloadGetSourceAttributeType(arg *CreateVolumePayloadGetSourceAttributeType, val CreateVolumePayloadGetSourceRetType) { + *arg = &val +} + +/* + types and functions for status +*/ + +// isNotNullableString +type CreateVolumePayloadGetStatusAttributeType = *string + +func getCreateVolumePayloadGetStatusAttributeTypeOk(arg CreateVolumePayloadGetStatusAttributeType) (ret CreateVolumePayloadGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateVolumePayloadGetStatusAttributeType(arg *CreateVolumePayloadGetStatusAttributeType, val CreateVolumePayloadGetStatusRetType) { + *arg = &val +} + +type CreateVolumePayloadGetStatusArgType = string +type CreateVolumePayloadGetStatusRetType = string + +/* + types and functions for updatedAt +*/ + +// isDateTime +type CreateVolumePayloadGetUpdatedAtAttributeType = *time.Time +type CreateVolumePayloadGetUpdatedAtArgType = time.Time +type CreateVolumePayloadGetUpdatedAtRetType = time.Time + +func getCreateVolumePayloadGetUpdatedAtAttributeTypeOk(arg CreateVolumePayloadGetUpdatedAtAttributeType) (ret CreateVolumePayloadGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateVolumePayloadGetUpdatedAtAttributeType(arg *CreateVolumePayloadGetUpdatedAtAttributeType, val CreateVolumePayloadGetUpdatedAtRetType) { + *arg = &val +} + // CreateVolumePayload Object that represents a volume and its parameters. Used for Creating and returning (get/list). type CreateVolumePayload struct { // Object that represents an availability zone. // REQUIRED - AvailabilityZone *string `json:"availabilityZone"` + AvailabilityZone CreateVolumePayloadGetAvailabilityZoneAttributeType `json:"availabilityZone"` // Indicates if a volume is bootable. - Bootable *bool `json:"bootable,omitempty"` + Bootable CreateVolumePayloadgetBootableAttributeType `json:"bootable,omitempty"` // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt CreateVolumePayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Description Object. Allows string up to 127 Characters. - Description *string `json:"description,omitempty"` + Description CreateVolumePayloadGetDescriptionAttributeType `json:"description,omitempty"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` - ImageConfig *ImageConfig `json:"imageConfig,omitempty"` + Id CreateVolumePayloadGetIdAttributeType `json:"id,omitempty"` + ImageConfig CreateVolumePayloadGetImageConfigAttributeType `json:"imageConfig,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels CreateVolumePayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty"` + Name CreateVolumePayloadGetNameAttributeType `json:"name,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - PerformanceClass *string `json:"performanceClass,omitempty"` + PerformanceClass CreateVolumePayloadGetPerformanceClassAttributeType `json:"performanceClass,omitempty"` // Universally Unique Identifier (UUID). - ServerId *string `json:"serverId,omitempty"` + ServerId CreateVolumePayloadGetServerIdAttributeType `json:"serverId,omitempty"` // Size in Gigabyte. - Size *int64 `json:"size,omitempty"` - Source *VolumeSource `json:"source,omitempty"` + Size CreateVolumePayloadGetSizeAttributeType `json:"size,omitempty"` + Source CreateVolumePayloadGetSourceAttributeType `json:"source,omitempty"` // The status of a volume object. Possible values: `ATTACHED`, `ATTACHING`, `AVAILABLE`, `AWAITING-TRANSFER`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `DETACHING`, `DOWNLOADING`, `ERROR`, `ERROR_BACKING-UP`, `ERROR_DELETING`, `ERROR_RESIZING`, `ERROR_RESTORING-BACKUP`, `MAINTENANCE`, `RESERVED`, `RESIZING`, `RESTORING-BACKUP`, `RETYPING`, `UPLOADING`. - Status *string `json:"status,omitempty"` + Status CreateVolumePayloadGetStatusAttributeType `json:"status,omitempty"` // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAt CreateVolumePayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } type _CreateVolumePayload CreateVolumePayload @@ -55,9 +342,9 @@ type _CreateVolumePayload CreateVolumePayload // 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 NewCreateVolumePayload(availabilityZone *string) *CreateVolumePayload { +func NewCreateVolumePayload(availabilityZone CreateVolumePayloadGetAvailabilityZoneArgType) *CreateVolumePayload { this := CreateVolumePayload{} - this.AvailabilityZone = availabilityZone + setCreateVolumePayloadGetAvailabilityZoneAttributeType(&this.AvailabilityZone, availabilityZone) return &this } @@ -70,486 +357,364 @@ func NewCreateVolumePayloadWithDefaults() *CreateVolumePayload { } // GetAvailabilityZone returns the AvailabilityZone field value -func (o *CreateVolumePayload) GetAvailabilityZone() *string { - if o == nil || IsNil(o.AvailabilityZone) { - var ret *string - return ret - } - - return o.AvailabilityZone +func (o *CreateVolumePayload) GetAvailabilityZone() (ret CreateVolumePayloadGetAvailabilityZoneRetType) { + ret, _ = o.GetAvailabilityZoneOk() + return ret } // GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value // and a boolean to check if the value has been set. -func (o *CreateVolumePayload) GetAvailabilityZoneOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.AvailabilityZone, true +func (o *CreateVolumePayload) GetAvailabilityZoneOk() (ret CreateVolumePayloadGetAvailabilityZoneRetType, ok bool) { + return getCreateVolumePayloadGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) } // SetAvailabilityZone sets field value -func (o *CreateVolumePayload) SetAvailabilityZone(v *string) { - o.AvailabilityZone = v +func (o *CreateVolumePayload) SetAvailabilityZone(v CreateVolumePayloadGetAvailabilityZoneRetType) { + setCreateVolumePayloadGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) } // GetBootable returns the Bootable field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetBootable() *bool { - if o == nil || IsNil(o.Bootable) { - var ret *bool - return ret - } - return o.Bootable +func (o *CreateVolumePayload) GetBootable() (res CreateVolumePayloadgetBootableRetType) { + res, _ = o.GetBootableOk() + return } // GetBootableOk returns a tuple with the Bootable field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateVolumePayload) GetBootableOk() (*bool, bool) { - if o == nil || IsNil(o.Bootable) { - return nil, false - } - return o.Bootable, true +func (o *CreateVolumePayload) GetBootableOk() (ret CreateVolumePayloadgetBootableRetType, ok bool) { + return getCreateVolumePayloadgetBootableAttributeTypeOk(o.Bootable) } // HasBootable returns a boolean if a field has been set. func (o *CreateVolumePayload) HasBootable() bool { - if o != nil && !IsNil(o.Bootable) { - return true - } - - return false + _, ok := o.GetBootableOk() + return ok } // SetBootable gets a reference to the given bool and assigns it to the Bootable field. -func (o *CreateVolumePayload) SetBootable(v *bool) { - o.Bootable = v +func (o *CreateVolumePayload) SetBootable(v CreateVolumePayloadgetBootableRetType) { + setCreateVolumePayloadgetBootableAttributeType(&o.Bootable, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - return o.CreatedAt +func (o *CreateVolumePayload) GetCreatedAt() (res CreateVolumePayloadGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return } // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateVolumePayload) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true +func (o *CreateVolumePayload) GetCreatedAtOk() (ret CreateVolumePayloadGetCreatedAtRetType, ok bool) { + return getCreateVolumePayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. func (o *CreateVolumePayload) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false + _, ok := o.GetCreatedAtOk() + return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *CreateVolumePayload) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *CreateVolumePayload) SetCreatedAt(v CreateVolumePayloadGetCreatedAtRetType) { + setCreateVolumePayloadGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *CreateVolumePayload) GetDescription() (res CreateVolumePayloadGetDescriptionRetType) { + 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 *CreateVolumePayload) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *CreateVolumePayload) GetDescriptionOk() (ret CreateVolumePayloadGetDescriptionRetType, ok bool) { + return getCreateVolumePayloadGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *CreateVolumePayload) 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 *CreateVolumePayload) SetDescription(v *string) { - o.Description = v +func (o *CreateVolumePayload) SetDescription(v CreateVolumePayloadGetDescriptionRetType) { + setCreateVolumePayloadGetDescriptionAttributeType(&o.Description, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *CreateVolumePayload) GetId() (res CreateVolumePayloadGetIdRetType) { + 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 *CreateVolumePayload) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *CreateVolumePayload) GetIdOk() (ret CreateVolumePayloadGetIdRetType, ok bool) { + return getCreateVolumePayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *CreateVolumePayload) 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 *CreateVolumePayload) SetId(v *string) { - o.Id = v +func (o *CreateVolumePayload) SetId(v CreateVolumePayloadGetIdRetType) { + setCreateVolumePayloadGetIdAttributeType(&o.Id, v) } // GetImageConfig returns the ImageConfig field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetImageConfig() *ImageConfig { - if o == nil || IsNil(o.ImageConfig) { - var ret *ImageConfig - return ret - } - return o.ImageConfig +func (o *CreateVolumePayload) GetImageConfig() (res CreateVolumePayloadGetImageConfigRetType) { + res, _ = o.GetImageConfigOk() + return } // GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateVolumePayload) GetImageConfigOk() (*ImageConfig, bool) { - if o == nil || IsNil(o.ImageConfig) { - return nil, false - } - return o.ImageConfig, true +func (o *CreateVolumePayload) GetImageConfigOk() (ret CreateVolumePayloadGetImageConfigRetType, ok bool) { + return getCreateVolumePayloadGetImageConfigAttributeTypeOk(o.ImageConfig) } // HasImageConfig returns a boolean if a field has been set. func (o *CreateVolumePayload) HasImageConfig() bool { - if o != nil && !IsNil(o.ImageConfig) { - return true - } - - return false + _, ok := o.GetImageConfigOk() + return ok } // SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. -func (o *CreateVolumePayload) SetImageConfig(v *ImageConfig) { - o.ImageConfig = v +func (o *CreateVolumePayload) SetImageConfig(v CreateVolumePayloadGetImageConfigRetType) { + setCreateVolumePayloadGetImageConfigAttributeType(&o.ImageConfig, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *CreateVolumePayload) GetLabels() (res CreateVolumePayloadGetLabelsRetType) { + 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 *CreateVolumePayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *CreateVolumePayload) GetLabelsOk() (ret CreateVolumePayloadGetLabelsRetType, ok bool) { + return getCreateVolumePayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *CreateVolumePayload) 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 *CreateVolumePayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *CreateVolumePayload) SetLabels(v CreateVolumePayloadGetLabelsRetType) { + setCreateVolumePayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *CreateVolumePayload) GetName() (res CreateVolumePayloadGetNameRetType) { + 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 *CreateVolumePayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *CreateVolumePayload) GetNameOk() (ret CreateVolumePayloadGetNameRetType, ok bool) { + return getCreateVolumePayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *CreateVolumePayload) 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 *CreateVolumePayload) SetName(v *string) { - o.Name = v +func (o *CreateVolumePayload) SetName(v CreateVolumePayloadGetNameRetType) { + setCreateVolumePayloadGetNameAttributeType(&o.Name, v) } // GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetPerformanceClass() *string { - if o == nil || IsNil(o.PerformanceClass) { - var ret *string - return ret - } - return o.PerformanceClass +func (o *CreateVolumePayload) GetPerformanceClass() (res CreateVolumePayloadGetPerformanceClassRetType) { + res, _ = o.GetPerformanceClassOk() + return } // GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateVolumePayload) GetPerformanceClassOk() (*string, bool) { - if o == nil || IsNil(o.PerformanceClass) { - return nil, false - } - return o.PerformanceClass, true +func (o *CreateVolumePayload) GetPerformanceClassOk() (ret CreateVolumePayloadGetPerformanceClassRetType, ok bool) { + return getCreateVolumePayloadGetPerformanceClassAttributeTypeOk(o.PerformanceClass) } // HasPerformanceClass returns a boolean if a field has been set. func (o *CreateVolumePayload) HasPerformanceClass() bool { - if o != nil && !IsNil(o.PerformanceClass) { - return true - } - - return false + _, ok := o.GetPerformanceClassOk() + return ok } // SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. -func (o *CreateVolumePayload) SetPerformanceClass(v *string) { - o.PerformanceClass = v +func (o *CreateVolumePayload) SetPerformanceClass(v CreateVolumePayloadGetPerformanceClassRetType) { + setCreateVolumePayloadGetPerformanceClassAttributeType(&o.PerformanceClass, v) } // GetServerId returns the ServerId field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetServerId() *string { - if o == nil || IsNil(o.ServerId) { - var ret *string - return ret - } - return o.ServerId +func (o *CreateVolumePayload) GetServerId() (res CreateVolumePayloadGetServerIdRetType) { + res, _ = o.GetServerIdOk() + return } // GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateVolumePayload) GetServerIdOk() (*string, bool) { - if o == nil || IsNil(o.ServerId) { - return nil, false - } - return o.ServerId, true +func (o *CreateVolumePayload) GetServerIdOk() (ret CreateVolumePayloadGetServerIdRetType, ok bool) { + return getCreateVolumePayloadGetServerIdAttributeTypeOk(o.ServerId) } // HasServerId returns a boolean if a field has been set. func (o *CreateVolumePayload) HasServerId() bool { - if o != nil && !IsNil(o.ServerId) { - return true - } - - return false + _, ok := o.GetServerIdOk() + return ok } // SetServerId gets a reference to the given string and assigns it to the ServerId field. -func (o *CreateVolumePayload) SetServerId(v *string) { - o.ServerId = v +func (o *CreateVolumePayload) SetServerId(v CreateVolumePayloadGetServerIdRetType) { + setCreateVolumePayloadGetServerIdAttributeType(&o.ServerId, v) } // GetSize returns the Size field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetSize() *int64 { - if o == nil || IsNil(o.Size) { - var ret *int64 - return ret - } - return o.Size +func (o *CreateVolumePayload) GetSize() (res CreateVolumePayloadGetSizeRetType) { + 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 *CreateVolumePayload) GetSizeOk() (*int64, bool) { - if o == nil || IsNil(o.Size) { - return nil, false - } - return o.Size, true +func (o *CreateVolumePayload) GetSizeOk() (ret CreateVolumePayloadGetSizeRetType, ok bool) { + return getCreateVolumePayloadGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. func (o *CreateVolumePayload) 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 *CreateVolumePayload) SetSize(v *int64) { - o.Size = v +func (o *CreateVolumePayload) SetSize(v CreateVolumePayloadGetSizeRetType) { + setCreateVolumePayloadGetSizeAttributeType(&o.Size, v) } // GetSource returns the Source field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetSource() *VolumeSource { - if o == nil || IsNil(o.Source) { - var ret *VolumeSource - return ret - } - return o.Source +func (o *CreateVolumePayload) GetSource() (res CreateVolumePayloadGetSourceRetType) { + res, _ = o.GetSourceOk() + return } // GetSourceOk returns a tuple with the Source field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateVolumePayload) GetSourceOk() (*VolumeSource, bool) { - if o == nil || IsNil(o.Source) { - return nil, false - } - return o.Source, true +func (o *CreateVolumePayload) GetSourceOk() (ret CreateVolumePayloadGetSourceRetType, ok bool) { + return getCreateVolumePayloadGetSourceAttributeTypeOk(o.Source) } // HasSource returns a boolean if a field has been set. func (o *CreateVolumePayload) HasSource() bool { - if o != nil && !IsNil(o.Source) { - return true - } - - return false + _, ok := o.GetSourceOk() + return ok } // SetSource gets a reference to the given VolumeSource and assigns it to the Source field. -func (o *CreateVolumePayload) SetSource(v *VolumeSource) { - o.Source = v +func (o *CreateVolumePayload) SetSource(v CreateVolumePayloadGetSourceRetType) { + setCreateVolumePayloadGetSourceAttributeType(&o.Source, v) } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - return o.Status +func (o *CreateVolumePayload) GetStatus() (res CreateVolumePayloadGetStatusRetType) { + 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 *CreateVolumePayload) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true +func (o *CreateVolumePayload) GetStatusOk() (ret CreateVolumePayloadGetStatusRetType, ok bool) { + return getCreateVolumePayloadGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. func (o *CreateVolumePayload) 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 *CreateVolumePayload) SetStatus(v *string) { - o.Status = v +func (o *CreateVolumePayload) SetStatus(v CreateVolumePayloadGetStatusRetType) { + setCreateVolumePayloadGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *CreateVolumePayload) GetUpdatedAt() *time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret *time.Time - return ret - } - return o.UpdatedAt +func (o *CreateVolumePayload) GetUpdatedAt() (res CreateVolumePayloadGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateVolumePayload) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true +func (o *CreateVolumePayload) GetUpdatedAtOk() (ret CreateVolumePayloadGetUpdatedAtRetType, ok bool) { + return getCreateVolumePayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. func (o *CreateVolumePayload) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false + _, ok := o.GetUpdatedAtOk() + return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *CreateVolumePayload) SetUpdatedAt(v *time.Time) { - o.UpdatedAt = v +func (o *CreateVolumePayload) SetUpdatedAt(v CreateVolumePayloadGetUpdatedAtRetType) { + setCreateVolumePayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) } func (o CreateVolumePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["availabilityZone"] = o.AvailabilityZone - if !IsNil(o.Bootable) { - toSerialize["bootable"] = o.Bootable + if val, ok := getCreateVolumePayloadGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { + toSerialize["AvailabilityZone"] = val + } + if val, ok := getCreateVolumePayloadgetBootableAttributeTypeOk(o.Bootable); ok { + toSerialize["Bootable"] = val } - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt + if val, ok := getCreateVolumePayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getCreateVolumePayloadGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getCreateVolumePayloadGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.ImageConfig) { - toSerialize["imageConfig"] = o.ImageConfig + if val, ok := getCreateVolumePayloadGetImageConfigAttributeTypeOk(o.ImageConfig); ok { + toSerialize["ImageConfig"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getCreateVolumePayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getCreateVolumePayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.PerformanceClass) { - toSerialize["performanceClass"] = o.PerformanceClass + if val, ok := getCreateVolumePayloadGetPerformanceClassAttributeTypeOk(o.PerformanceClass); ok { + toSerialize["PerformanceClass"] = val } - if !IsNil(o.ServerId) { - toSerialize["serverId"] = o.ServerId + if val, ok := getCreateVolumePayloadGetServerIdAttributeTypeOk(o.ServerId); ok { + toSerialize["ServerId"] = val } - if !IsNil(o.Size) { - toSerialize["size"] = o.Size + if val, ok := getCreateVolumePayloadGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val } - if !IsNil(o.Source) { - toSerialize["source"] = o.Source + if val, ok := getCreateVolumePayloadGetSourceAttributeTypeOk(o.Source); ok { + toSerialize["Source"] = val } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status + if val, ok := getCreateVolumePayloadGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt + if val, ok := getCreateVolumePayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val } return toSerialize, nil } diff --git a/services/iaas/model_error.go b/services/iaas/model_error.go index 61ea45dc0..6afb78dc2 100644 --- a/services/iaas/model_error.go +++ b/services/iaas/model_error.go @@ -17,13 +17,54 @@ import ( // checks if the Error type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Error{} +/* + types and functions for code +*/ + +// isLong +type ErrorGetCodeAttributeType = *int64 +type ErrorGetCodeArgType = int64 +type ErrorGetCodeRetType = int64 + +func getErrorGetCodeAttributeTypeOk(arg ErrorGetCodeAttributeType) (ret ErrorGetCodeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorGetCodeAttributeType(arg *ErrorGetCodeAttributeType, val ErrorGetCodeRetType) { + *arg = &val +} + +/* + types and functions for msg +*/ + +// isNotNullableString +type ErrorGetMsgAttributeType = *string + +func getErrorGetMsgAttributeTypeOk(arg ErrorGetMsgAttributeType) (ret ErrorGetMsgRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorGetMsgAttributeType(arg *ErrorGetMsgAttributeType, val ErrorGetMsgRetType) { + *arg = &val +} + +type ErrorGetMsgArgType = string +type ErrorGetMsgRetType = string + // Error Error with HTTP error code and an error message. type Error struct { // REQUIRED - Code *int64 `json:"code"` + Code ErrorGetCodeAttributeType `json:"code"` // An error message. // REQUIRED - Msg *string `json:"msg"` + Msg ErrorGetMsgAttributeType `json:"msg"` } type _Error Error @@ -32,10 +73,10 @@ type _Error Error // 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 NewError(code *int64, msg *string) *Error { +func NewError(code ErrorGetCodeArgType, msg ErrorGetMsgArgType) *Error { this := Error{} - this.Code = code - this.Msg = msg + setErrorGetCodeAttributeType(&this.Code, code) + setErrorGetMsgAttributeType(&this.Msg, msg) return &this } @@ -48,57 +89,47 @@ func NewErrorWithDefaults() *Error { } // GetCode returns the Code field value -func (o *Error) GetCode() *int64 { - if o == nil || IsNil(o.Code) { - var ret *int64 - return ret - } - - return o.Code +func (o *Error) GetCode() (ret ErrorGetCodeRetType) { + ret, _ = o.GetCodeOk() + return ret } // GetCodeOk returns a tuple with the Code field value // and a boolean to check if the value has been set. -func (o *Error) GetCodeOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Code, true +func (o *Error) GetCodeOk() (ret ErrorGetCodeRetType, ok bool) { + return getErrorGetCodeAttributeTypeOk(o.Code) } // SetCode sets field value -func (o *Error) SetCode(v *int64) { - o.Code = v +func (o *Error) SetCode(v ErrorGetCodeRetType) { + setErrorGetCodeAttributeType(&o.Code, v) } // GetMsg returns the Msg field value -func (o *Error) GetMsg() *string { - if o == nil || IsNil(o.Msg) { - var ret *string - return ret - } - - return o.Msg +func (o *Error) GetMsg() (ret ErrorGetMsgRetType) { + ret, _ = o.GetMsgOk() + return ret } // GetMsgOk returns a tuple with the Msg field value // and a boolean to check if the value has been set. -func (o *Error) GetMsgOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Msg, true +func (o *Error) GetMsgOk() (ret ErrorGetMsgRetType, ok bool) { + return getErrorGetMsgAttributeTypeOk(o.Msg) } // SetMsg sets field value -func (o *Error) SetMsg(v *string) { - o.Msg = v +func (o *Error) SetMsg(v ErrorGetMsgRetType) { + setErrorGetMsgAttributeType(&o.Msg, v) } func (o Error) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["code"] = o.Code - toSerialize["msg"] = o.Msg + if val, ok := getErrorGetCodeAttributeTypeOk(o.Code); ok { + toSerialize["Code"] = val + } + if val, ok := getErrorGetMsgAttributeTypeOk(o.Msg); ok { + toSerialize["Msg"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_get_server_log_200_response.go b/services/iaas/model_get_server_log_200_response.go index bbabc0b89..f64e60291 100644 --- a/services/iaas/model_get_server_log_200_response.go +++ b/services/iaas/model_get_server_log_200_response.go @@ -17,9 +17,30 @@ import ( // checks if the GetServerLog200Response type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetServerLog200Response{} +/* + types and functions for output +*/ + +// isNotNullableString +type GetServerLog200ResponseGetOutputAttributeType = *string + +func getGetServerLog200ResponseGetOutputAttributeTypeOk(arg GetServerLog200ResponseGetOutputAttributeType) (ret GetServerLog200ResponseGetOutputRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetServerLog200ResponseGetOutputAttributeType(arg *GetServerLog200ResponseGetOutputAttributeType, val GetServerLog200ResponseGetOutputRetType) { + *arg = &val +} + +type GetServerLog200ResponseGetOutputArgType = string +type GetServerLog200ResponseGetOutputRetType = string + // GetServerLog200Response struct for GetServerLog200Response type GetServerLog200Response struct { - Output *string `json:"output,omitempty"` + Output GetServerLog200ResponseGetOutputAttributeType `json:"output,omitempty"` } // NewGetServerLog200Response instantiates a new GetServerLog200Response object @@ -40,41 +61,32 @@ func NewGetServerLog200ResponseWithDefaults() *GetServerLog200Response { } // GetOutput returns the Output field value if set, zero value otherwise. -func (o *GetServerLog200Response) GetOutput() *string { - if o == nil || IsNil(o.Output) { - var ret *string - return ret - } - return o.Output +func (o *GetServerLog200Response) GetOutput() (res GetServerLog200ResponseGetOutputRetType) { + res, _ = o.GetOutputOk() + return } // GetOutputOk returns a tuple with the Output field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetServerLog200Response) GetOutputOk() (*string, bool) { - if o == nil || IsNil(o.Output) { - return nil, false - } - return o.Output, true +func (o *GetServerLog200Response) GetOutputOk() (ret GetServerLog200ResponseGetOutputRetType, ok bool) { + return getGetServerLog200ResponseGetOutputAttributeTypeOk(o.Output) } // HasOutput returns a boolean if a field has been set. func (o *GetServerLog200Response) HasOutput() bool { - if o != nil && !IsNil(o.Output) { - return true - } - - return false + _, ok := o.GetOutputOk() + return ok } // SetOutput gets a reference to the given string and assigns it to the Output field. -func (o *GetServerLog200Response) SetOutput(v *string) { - o.Output = v +func (o *GetServerLog200Response) SetOutput(v GetServerLog200ResponseGetOutputRetType) { + setGetServerLog200ResponseGetOutputAttributeType(&o.Output, v) } func (o GetServerLog200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Output) { - toSerialize["output"] = o.Output + if val, ok := getGetServerLog200ResponseGetOutputAttributeTypeOk(o.Output); ok { + toSerialize["Output"] = val } return toSerialize, nil } diff --git a/services/iaas/model_icmp_parameters.go b/services/iaas/model_icmp_parameters.go index 93ba53e9e..ed856ec0a 100644 --- a/services/iaas/model_icmp_parameters.go +++ b/services/iaas/model_icmp_parameters.go @@ -17,14 +17,54 @@ import ( // checks if the ICMPParameters type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ICMPParameters{} +/* + types and functions for code +*/ + +// isLong +type ICMPParametersGetCodeAttributeType = *int64 +type ICMPParametersGetCodeArgType = int64 +type ICMPParametersGetCodeRetType = int64 + +func getICMPParametersGetCodeAttributeTypeOk(arg ICMPParametersGetCodeAttributeType) (ret ICMPParametersGetCodeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setICMPParametersGetCodeAttributeType(arg *ICMPParametersGetCodeAttributeType, val ICMPParametersGetCodeRetType) { + *arg = &val +} + +/* + types and functions for type +*/ + +// isLong +type ICMPParametersGetTypeAttributeType = *int64 +type ICMPParametersGetTypeArgType = int64 +type ICMPParametersGetTypeRetType = int64 + +func getICMPParametersGetTypeAttributeTypeOk(arg ICMPParametersGetTypeAttributeType) (ret ICMPParametersGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setICMPParametersGetTypeAttributeType(arg *ICMPParametersGetTypeAttributeType, val ICMPParametersGetTypeRetType) { + *arg = &val +} + // ICMPParameters Object that represents ICMP parameters. type ICMPParameters struct { // ICMP code. Can be set if the protocol is ICMP. // REQUIRED - Code *int64 `json:"code"` + Code ICMPParametersGetCodeAttributeType `json:"code"` // ICMP type. Can be set if the protocol is ICMP. // REQUIRED - Type *int64 `json:"type"` + Type ICMPParametersGetTypeAttributeType `json:"type"` } type _ICMPParameters ICMPParameters @@ -33,10 +73,10 @@ type _ICMPParameters ICMPParameters // 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 NewICMPParameters(code *int64, type_ *int64) *ICMPParameters { +func NewICMPParameters(code ICMPParametersGetCodeArgType, type_ ICMPParametersGetTypeArgType) *ICMPParameters { this := ICMPParameters{} - this.Code = code - this.Type = type_ + setICMPParametersGetCodeAttributeType(&this.Code, code) + setICMPParametersGetTypeAttributeType(&this.Type, type_) return &this } @@ -49,57 +89,47 @@ func NewICMPParametersWithDefaults() *ICMPParameters { } // GetCode returns the Code field value -func (o *ICMPParameters) GetCode() *int64 { - if o == nil || IsNil(o.Code) { - var ret *int64 - return ret - } - - return o.Code +func (o *ICMPParameters) GetCode() (ret ICMPParametersGetCodeRetType) { + ret, _ = o.GetCodeOk() + return ret } // GetCodeOk returns a tuple with the Code field value // and a boolean to check if the value has been set. -func (o *ICMPParameters) GetCodeOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Code, true +func (o *ICMPParameters) GetCodeOk() (ret ICMPParametersGetCodeRetType, ok bool) { + return getICMPParametersGetCodeAttributeTypeOk(o.Code) } // SetCode sets field value -func (o *ICMPParameters) SetCode(v *int64) { - o.Code = v +func (o *ICMPParameters) SetCode(v ICMPParametersGetCodeRetType) { + setICMPParametersGetCodeAttributeType(&o.Code, v) } // GetType returns the Type field value -func (o *ICMPParameters) GetType() *int64 { - if o == nil || IsNil(o.Type) { - var ret *int64 - return ret - } - - return o.Type +func (o *ICMPParameters) GetType() (ret ICMPParametersGetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret } // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *ICMPParameters) GetTypeOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Type, true +func (o *ICMPParameters) GetTypeOk() (ret ICMPParametersGetTypeRetType, ok bool) { + return getICMPParametersGetTypeAttributeTypeOk(o.Type) } // SetType sets field value -func (o *ICMPParameters) SetType(v *int64) { - o.Type = v +func (o *ICMPParameters) SetType(v ICMPParametersGetTypeRetType) { + setICMPParametersGetTypeAttributeType(&o.Type, v) } func (o ICMPParameters) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["code"] = o.Code - toSerialize["type"] = o.Type + if val, ok := getICMPParametersGetCodeAttributeTypeOk(o.Code); ok { + toSerialize["Code"] = val + } + if val, ok := getICMPParametersGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_image.go b/services/iaas/model_image.go index 09a171728..063b730da 100644 --- a/services/iaas/model_image.go +++ b/services/iaas/model_image.go @@ -18,37 +18,343 @@ import ( // checks if the Image type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Image{} +/* + types and functions for checksum +*/ + +// isModel +type ImageGetChecksumAttributeType = *ImageChecksum +type ImageGetChecksumArgType = ImageChecksum +type ImageGetChecksumRetType = ImageChecksum + +func getImageGetChecksumAttributeTypeOk(arg ImageGetChecksumAttributeType) (ret ImageGetChecksumRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageGetChecksumAttributeType(arg *ImageGetChecksumAttributeType, val ImageGetChecksumRetType) { + *arg = &val +} + +/* + types and functions for config +*/ + +// isModel +type ImageGetConfigAttributeType = *ImageConfig +type ImageGetConfigArgType = ImageConfig +type ImageGetConfigRetType = ImageConfig + +func getImageGetConfigAttributeTypeOk(arg ImageGetConfigAttributeType) (ret ImageGetConfigRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageGetConfigAttributeType(arg *ImageGetConfigAttributeType, val ImageGetConfigRetType) { + *arg = &val +} + +/* + types and functions for createdAt +*/ + +// isDateTime +type ImageGetCreatedAtAttributeType = *time.Time +type ImageGetCreatedAtArgType = time.Time +type ImageGetCreatedAtRetType = time.Time + +func getImageGetCreatedAtAttributeTypeOk(arg ImageGetCreatedAtAttributeType) (ret ImageGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageGetCreatedAtAttributeType(arg *ImageGetCreatedAtAttributeType, val ImageGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for diskFormat +*/ + +// isNotNullableString +type ImageGetDiskFormatAttributeType = *string + +func getImageGetDiskFormatAttributeTypeOk(arg ImageGetDiskFormatAttributeType) (ret ImageGetDiskFormatRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageGetDiskFormatAttributeType(arg *ImageGetDiskFormatAttributeType, val ImageGetDiskFormatRetType) { + *arg = &val +} + +type ImageGetDiskFormatArgType = string +type ImageGetDiskFormatRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type ImageGetIdAttributeType = *string + +func getImageGetIdAttributeTypeOk(arg ImageGetIdAttributeType) (ret ImageGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageGetIdAttributeType(arg *ImageGetIdAttributeType, val ImageGetIdRetType) { + *arg = &val +} + +type ImageGetIdArgType = string +type ImageGetIdRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type ImageGetLabelsAttributeType = *map[string]interface{} +type ImageGetLabelsArgType = map[string]interface{} +type ImageGetLabelsRetType = map[string]interface{} + +func getImageGetLabelsAttributeTypeOk(arg ImageGetLabelsAttributeType) (ret ImageGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageGetLabelsAttributeType(arg *ImageGetLabelsAttributeType, val ImageGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for minDiskSize +*/ + +// isLong +type ImageGetMinDiskSizeAttributeType = *int64 +type ImageGetMinDiskSizeArgType = int64 +type ImageGetMinDiskSizeRetType = int64 + +func getImageGetMinDiskSizeAttributeTypeOk(arg ImageGetMinDiskSizeAttributeType) (ret ImageGetMinDiskSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageGetMinDiskSizeAttributeType(arg *ImageGetMinDiskSizeAttributeType, val ImageGetMinDiskSizeRetType) { + *arg = &val +} + +/* + types and functions for minRam +*/ + +// isLong +type ImageGetMinRamAttributeType = *int64 +type ImageGetMinRamArgType = int64 +type ImageGetMinRamRetType = int64 + +func getImageGetMinRamAttributeTypeOk(arg ImageGetMinRamAttributeType) (ret ImageGetMinRamRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageGetMinRamAttributeType(arg *ImageGetMinRamAttributeType, val ImageGetMinRamRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type ImageGetNameAttributeType = *string + +func getImageGetNameAttributeTypeOk(arg ImageGetNameAttributeType) (ret ImageGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageGetNameAttributeType(arg *ImageGetNameAttributeType, val ImageGetNameRetType) { + *arg = &val +} + +type ImageGetNameArgType = string +type ImageGetNameRetType = string + +/* + types and functions for owner +*/ + +// isNotNullableString +type ImageGetOwnerAttributeType = *string + +func getImageGetOwnerAttributeTypeOk(arg ImageGetOwnerAttributeType) (ret ImageGetOwnerRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageGetOwnerAttributeType(arg *ImageGetOwnerAttributeType, val ImageGetOwnerRetType) { + *arg = &val +} + +type ImageGetOwnerArgType = string +type ImageGetOwnerRetType = string + +/* + types and functions for protected +*/ + +// isBoolean +type ImagegetProtectedAttributeType = *bool +type ImagegetProtectedArgType = bool +type ImagegetProtectedRetType = bool + +func getImagegetProtectedAttributeTypeOk(arg ImagegetProtectedAttributeType) (ret ImagegetProtectedRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImagegetProtectedAttributeType(arg *ImagegetProtectedAttributeType, val ImagegetProtectedRetType) { + *arg = &val +} + +/* + types and functions for scope +*/ + +// isNotNullableString +type ImageGetScopeAttributeType = *string + +func getImageGetScopeAttributeTypeOk(arg ImageGetScopeAttributeType) (ret ImageGetScopeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageGetScopeAttributeType(arg *ImageGetScopeAttributeType, val ImageGetScopeRetType) { + *arg = &val +} + +type ImageGetScopeArgType = string +type ImageGetScopeRetType = string + +/* + types and functions for size +*/ + +// isLong +type ImageGetSizeAttributeType = *int64 +type ImageGetSizeArgType = int64 +type ImageGetSizeRetType = int64 + +func getImageGetSizeAttributeTypeOk(arg ImageGetSizeAttributeType) (ret ImageGetSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageGetSizeAttributeType(arg *ImageGetSizeAttributeType, val ImageGetSizeRetType) { + *arg = &val +} + +/* + types and functions for status +*/ + +// isNotNullableString +type ImageGetStatusAttributeType = *string + +func getImageGetStatusAttributeTypeOk(arg ImageGetStatusAttributeType) (ret ImageGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageGetStatusAttributeType(arg *ImageGetStatusAttributeType, val ImageGetStatusRetType) { + *arg = &val +} + +type ImageGetStatusArgType = string +type ImageGetStatusRetType = string + +/* + types and functions for updatedAt +*/ + +// isDateTime +type ImageGetUpdatedAtAttributeType = *time.Time +type ImageGetUpdatedAtArgType = time.Time +type ImageGetUpdatedAtRetType = time.Time + +func getImageGetUpdatedAtAttributeTypeOk(arg ImageGetUpdatedAtAttributeType) (ret ImageGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageGetUpdatedAtAttributeType(arg *ImageGetUpdatedAtAttributeType, val ImageGetUpdatedAtRetType) { + *arg = &val +} + // Image Object that represents an Image and its parameters. Used for Creating and returning (get/list). type Image struct { - Checksum *ImageChecksum `json:"checksum,omitempty"` - Config *ImageConfig `json:"config,omitempty"` + Checksum ImageGetChecksumAttributeType `json:"checksum,omitempty"` + Config ImageGetConfigAttributeType `json:"config,omitempty"` // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt ImageGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`. // REQUIRED - DiskFormat *string `json:"diskFormat"` + DiskFormat ImageGetDiskFormatAttributeType `json:"diskFormat"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id ImageGetIdAttributeType `json:"id,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels ImageGetLabelsAttributeType `json:"labels,omitempty"` // Size in Gigabyte. - MinDiskSize *int64 `json:"minDiskSize,omitempty"` + MinDiskSize ImageGetMinDiskSizeAttributeType `json:"minDiskSize,omitempty"` // Size in Megabyte. - MinRam *int64 `json:"minRam,omitempty"` + MinRam ImageGetMinRamAttributeType `json:"minRam,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED - Name *string `json:"name"` + Name ImageGetNameAttributeType `json:"name"` // Universally Unique Identifier (UUID). - Owner *string `json:"owner,omitempty"` - Protected *bool `json:"protected,omitempty"` + Owner ImageGetOwnerAttributeType `json:"owner,omitempty"` + Protected ImagegetProtectedAttributeType `json:"protected,omitempty"` // Scope of an Image. Possible values: `public`, `local`, `projects`, `organization`. - Scope *string `json:"scope,omitempty"` + Scope ImageGetScopeAttributeType `json:"scope,omitempty"` // Size in bytes. - Size *int64 `json:"size,omitempty"` + Size ImageGetSizeAttributeType `json:"size,omitempty"` // The status of an image object. Possible values: `AVAILABLE`, `CREATING`, `DEACTIVATED`, `DELETED`, `DELETING`, `ERROR`. - Status *string `json:"status,omitempty"` + Status ImageGetStatusAttributeType `json:"status,omitempty"` // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAt ImageGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } type _Image Image @@ -57,10 +363,10 @@ type _Image Image // 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 NewImage(diskFormat *string, name *string) *Image { +func NewImage(diskFormat ImageGetDiskFormatArgType, name ImageGetNameArgType) *Image { this := Image{} - this.DiskFormat = diskFormat - this.Name = name + setImageGetDiskFormatAttributeType(&this.DiskFormat, diskFormat) + setImageGetNameAttributeType(&this.Name, name) return &this } @@ -73,511 +379,384 @@ func NewImageWithDefaults() *Image { } // GetChecksum returns the Checksum field value if set, zero value otherwise. -func (o *Image) GetChecksum() *ImageChecksum { - if o == nil || IsNil(o.Checksum) { - var ret *ImageChecksum - return ret - } - return o.Checksum +func (o *Image) GetChecksum() (res ImageGetChecksumRetType) { + res, _ = o.GetChecksumOk() + return } // GetChecksumOk returns a tuple with the Checksum field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Image) GetChecksumOk() (*ImageChecksum, bool) { - if o == nil || IsNil(o.Checksum) { - return nil, false - } - return o.Checksum, true +func (o *Image) GetChecksumOk() (ret ImageGetChecksumRetType, ok bool) { + return getImageGetChecksumAttributeTypeOk(o.Checksum) } // HasChecksum returns a boolean if a field has been set. func (o *Image) HasChecksum() bool { - if o != nil && !IsNil(o.Checksum) { - return true - } - - return false + _, ok := o.GetChecksumOk() + return ok } // SetChecksum gets a reference to the given ImageChecksum and assigns it to the Checksum field. -func (o *Image) SetChecksum(v *ImageChecksum) { - o.Checksum = v +func (o *Image) SetChecksum(v ImageGetChecksumRetType) { + setImageGetChecksumAttributeType(&o.Checksum, v) } // GetConfig returns the Config field value if set, zero value otherwise. -func (o *Image) GetConfig() *ImageConfig { - if o == nil || IsNil(o.Config) { - var ret *ImageConfig - return ret - } - return o.Config +func (o *Image) GetConfig() (res ImageGetConfigRetType) { + res, _ = o.GetConfigOk() + return } // GetConfigOk returns a tuple with the Config field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Image) GetConfigOk() (*ImageConfig, bool) { - if o == nil || IsNil(o.Config) { - return nil, false - } - return o.Config, true +func (o *Image) GetConfigOk() (ret ImageGetConfigRetType, ok bool) { + return getImageGetConfigAttributeTypeOk(o.Config) } // HasConfig returns a boolean if a field has been set. func (o *Image) HasConfig() bool { - if o != nil && !IsNil(o.Config) { - return true - } - - return false + _, ok := o.GetConfigOk() + return ok } // SetConfig gets a reference to the given ImageConfig and assigns it to the Config field. -func (o *Image) SetConfig(v *ImageConfig) { - o.Config = v +func (o *Image) SetConfig(v ImageGetConfigRetType) { + setImageGetConfigAttributeType(&o.Config, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *Image) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - return o.CreatedAt +func (o *Image) GetCreatedAt() (res ImageGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return } // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Image) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true +func (o *Image) GetCreatedAtOk() (ret ImageGetCreatedAtRetType, ok bool) { + return getImageGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. func (o *Image) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false + _, ok := o.GetCreatedAtOk() + return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *Image) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *Image) SetCreatedAt(v ImageGetCreatedAtRetType) { + setImageGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDiskFormat returns the DiskFormat field value -func (o *Image) GetDiskFormat() *string { - if o == nil || IsNil(o.DiskFormat) { - var ret *string - return ret - } - - return o.DiskFormat +func (o *Image) GetDiskFormat() (ret ImageGetDiskFormatRetType) { + ret, _ = o.GetDiskFormatOk() + return ret } // GetDiskFormatOk returns a tuple with the DiskFormat field value // and a boolean to check if the value has been set. -func (o *Image) GetDiskFormatOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.DiskFormat, true +func (o *Image) GetDiskFormatOk() (ret ImageGetDiskFormatRetType, ok bool) { + return getImageGetDiskFormatAttributeTypeOk(o.DiskFormat) } // SetDiskFormat sets field value -func (o *Image) SetDiskFormat(v *string) { - o.DiskFormat = v +func (o *Image) SetDiskFormat(v ImageGetDiskFormatRetType) { + setImageGetDiskFormatAttributeType(&o.DiskFormat, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *Image) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *Image) GetId() (res ImageGetIdRetType) { + 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 *Image) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *Image) GetIdOk() (ret ImageGetIdRetType, ok bool) { + return getImageGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *Image) 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 *Image) SetId(v *string) { - o.Id = v +func (o *Image) SetId(v ImageGetIdRetType) { + setImageGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *Image) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *Image) GetLabels() (res ImageGetLabelsRetType) { + 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 *Image) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *Image) GetLabelsOk() (ret ImageGetLabelsRetType, ok bool) { + return getImageGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *Image) 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 *Image) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *Image) SetLabels(v ImageGetLabelsRetType) { + setImageGetLabelsAttributeType(&o.Labels, v) } // GetMinDiskSize returns the MinDiskSize field value if set, zero value otherwise. -func (o *Image) GetMinDiskSize() *int64 { - if o == nil || IsNil(o.MinDiskSize) { - var ret *int64 - return ret - } - return o.MinDiskSize +func (o *Image) GetMinDiskSize() (res ImageGetMinDiskSizeRetType) { + res, _ = o.GetMinDiskSizeOk() + return } // GetMinDiskSizeOk returns a tuple with the MinDiskSize field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Image) GetMinDiskSizeOk() (*int64, bool) { - if o == nil || IsNil(o.MinDiskSize) { - return nil, false - } - return o.MinDiskSize, true +func (o *Image) GetMinDiskSizeOk() (ret ImageGetMinDiskSizeRetType, ok bool) { + return getImageGetMinDiskSizeAttributeTypeOk(o.MinDiskSize) } // HasMinDiskSize returns a boolean if a field has been set. func (o *Image) HasMinDiskSize() bool { - if o != nil && !IsNil(o.MinDiskSize) { - return true - } - - return false + _, ok := o.GetMinDiskSizeOk() + return ok } // SetMinDiskSize gets a reference to the given int64 and assigns it to the MinDiskSize field. -func (o *Image) SetMinDiskSize(v *int64) { - o.MinDiskSize = v +func (o *Image) SetMinDiskSize(v ImageGetMinDiskSizeRetType) { + setImageGetMinDiskSizeAttributeType(&o.MinDiskSize, v) } // GetMinRam returns the MinRam field value if set, zero value otherwise. -func (o *Image) GetMinRam() *int64 { - if o == nil || IsNil(o.MinRam) { - var ret *int64 - return ret - } - return o.MinRam +func (o *Image) GetMinRam() (res ImageGetMinRamRetType) { + res, _ = o.GetMinRamOk() + return } // GetMinRamOk returns a tuple with the MinRam field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Image) GetMinRamOk() (*int64, bool) { - if o == nil || IsNil(o.MinRam) { - return nil, false - } - return o.MinRam, true +func (o *Image) GetMinRamOk() (ret ImageGetMinRamRetType, ok bool) { + return getImageGetMinRamAttributeTypeOk(o.MinRam) } // HasMinRam returns a boolean if a field has been set. func (o *Image) HasMinRam() bool { - if o != nil && !IsNil(o.MinRam) { - return true - } - - return false + _, ok := o.GetMinRamOk() + return ok } // SetMinRam gets a reference to the given int64 and assigns it to the MinRam field. -func (o *Image) SetMinRam(v *int64) { - o.MinRam = v +func (o *Image) SetMinRam(v ImageGetMinRamRetType) { + setImageGetMinRamAttributeType(&o.MinRam, v) } // GetName returns the Name field value -func (o *Image) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *Image) GetName() (ret ImageGetNameRetType) { + 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 *Image) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *Image) GetNameOk() (ret ImageGetNameRetType, ok bool) { + return getImageGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *Image) SetName(v *string) { - o.Name = v +func (o *Image) SetName(v ImageGetNameRetType) { + setImageGetNameAttributeType(&o.Name, v) } // GetOwner returns the Owner field value if set, zero value otherwise. -func (o *Image) GetOwner() *string { - if o == nil || IsNil(o.Owner) { - var ret *string - return ret - } - return o.Owner +func (o *Image) GetOwner() (res ImageGetOwnerRetType) { + 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 *Image) GetOwnerOk() (*string, bool) { - if o == nil || IsNil(o.Owner) { - return nil, false - } - return o.Owner, true +func (o *Image) GetOwnerOk() (ret ImageGetOwnerRetType, ok bool) { + return getImageGetOwnerAttributeTypeOk(o.Owner) } // HasOwner returns a boolean if a field has been set. func (o *Image) 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 *Image) SetOwner(v *string) { - o.Owner = v +func (o *Image) SetOwner(v ImageGetOwnerRetType) { + setImageGetOwnerAttributeType(&o.Owner, v) } // GetProtected returns the Protected field value if set, zero value otherwise. -func (o *Image) GetProtected() *bool { - if o == nil || IsNil(o.Protected) { - var ret *bool - return ret - } - return o.Protected +func (o *Image) GetProtected() (res ImagegetProtectedRetType) { + res, _ = o.GetProtectedOk() + return } // GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Image) GetProtectedOk() (*bool, bool) { - if o == nil || IsNil(o.Protected) { - return nil, false - } - return o.Protected, true +func (o *Image) GetProtectedOk() (ret ImagegetProtectedRetType, ok bool) { + return getImagegetProtectedAttributeTypeOk(o.Protected) } // HasProtected returns a boolean if a field has been set. func (o *Image) HasProtected() bool { - if o != nil && !IsNil(o.Protected) { - return true - } - - return false + _, ok := o.GetProtectedOk() + return ok } // SetProtected gets a reference to the given bool and assigns it to the Protected field. -func (o *Image) SetProtected(v *bool) { - o.Protected = v +func (o *Image) SetProtected(v ImagegetProtectedRetType) { + setImagegetProtectedAttributeType(&o.Protected, v) } // GetScope returns the Scope field value if set, zero value otherwise. -func (o *Image) GetScope() *string { - if o == nil || IsNil(o.Scope) { - var ret *string - return ret - } - return o.Scope +func (o *Image) GetScope() (res ImageGetScopeRetType) { + res, _ = o.GetScopeOk() + return } // GetScopeOk returns a tuple with the Scope field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Image) GetScopeOk() (*string, bool) { - if o == nil || IsNil(o.Scope) { - return nil, false - } - return o.Scope, true +func (o *Image) GetScopeOk() (ret ImageGetScopeRetType, ok bool) { + return getImageGetScopeAttributeTypeOk(o.Scope) } // HasScope returns a boolean if a field has been set. func (o *Image) HasScope() bool { - if o != nil && !IsNil(o.Scope) { - return true - } - - return false + _, ok := o.GetScopeOk() + return ok } // SetScope gets a reference to the given string and assigns it to the Scope field. -func (o *Image) SetScope(v *string) { - o.Scope = v +func (o *Image) SetScope(v ImageGetScopeRetType) { + setImageGetScopeAttributeType(&o.Scope, v) } // GetSize returns the Size field value if set, zero value otherwise. -func (o *Image) GetSize() *int64 { - if o == nil || IsNil(o.Size) { - var ret *int64 - return ret - } - return o.Size +func (o *Image) GetSize() (res ImageGetSizeRetType) { + 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 *Image) GetSizeOk() (*int64, bool) { - if o == nil || IsNil(o.Size) { - return nil, false - } - return o.Size, true +func (o *Image) GetSizeOk() (ret ImageGetSizeRetType, ok bool) { + return getImageGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. func (o *Image) 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 *Image) SetSize(v *int64) { - o.Size = v +func (o *Image) SetSize(v ImageGetSizeRetType) { + setImageGetSizeAttributeType(&o.Size, v) } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *Image) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - return o.Status +func (o *Image) GetStatus() (res ImageGetStatusRetType) { + 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 *Image) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true +func (o *Image) GetStatusOk() (ret ImageGetStatusRetType, ok bool) { + return getImageGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. func (o *Image) 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 *Image) SetStatus(v *string) { - o.Status = v +func (o *Image) SetStatus(v ImageGetStatusRetType) { + setImageGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *Image) GetUpdatedAt() *time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret *time.Time - return ret - } - return o.UpdatedAt +func (o *Image) GetUpdatedAt() (res ImageGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Image) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true +func (o *Image) GetUpdatedAtOk() (ret ImageGetUpdatedAtRetType, ok bool) { + return getImageGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. func (o *Image) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false + _, ok := o.GetUpdatedAtOk() + return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *Image) SetUpdatedAt(v *time.Time) { - o.UpdatedAt = v +func (o *Image) SetUpdatedAt(v ImageGetUpdatedAtRetType) { + setImageGetUpdatedAtAttributeType(&o.UpdatedAt, v) } func (o Image) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Checksum) { - toSerialize["checksum"] = o.Checksum + if val, ok := getImageGetChecksumAttributeTypeOk(o.Checksum); ok { + toSerialize["Checksum"] = val + } + if val, ok := getImageGetConfigAttributeTypeOk(o.Config); ok { + toSerialize["Config"] = val + } + if val, ok := getImageGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val } - if !IsNil(o.Config) { - toSerialize["config"] = o.Config + if val, ok := getImageGetDiskFormatAttributeTypeOk(o.DiskFormat); ok { + toSerialize["DiskFormat"] = val } - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt + if val, ok := getImageGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - toSerialize["diskFormat"] = o.DiskFormat - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getImageGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getImageGetMinDiskSizeAttributeTypeOk(o.MinDiskSize); ok { + toSerialize["MinDiskSize"] = val } - if !IsNil(o.MinDiskSize) { - toSerialize["minDiskSize"] = o.MinDiskSize + if val, ok := getImageGetMinRamAttributeTypeOk(o.MinRam); ok { + toSerialize["MinRam"] = val } - if !IsNil(o.MinRam) { - toSerialize["minRam"] = o.MinRam + if val, ok := getImageGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - toSerialize["name"] = o.Name - if !IsNil(o.Owner) { - toSerialize["owner"] = o.Owner + if val, ok := getImageGetOwnerAttributeTypeOk(o.Owner); ok { + toSerialize["Owner"] = val } - if !IsNil(o.Protected) { - toSerialize["protected"] = o.Protected + if val, ok := getImagegetProtectedAttributeTypeOk(o.Protected); ok { + toSerialize["Protected"] = val } - if !IsNil(o.Scope) { - toSerialize["scope"] = o.Scope + if val, ok := getImageGetScopeAttributeTypeOk(o.Scope); ok { + toSerialize["Scope"] = val } - if !IsNil(o.Size) { - toSerialize["size"] = o.Size + if val, ok := getImageGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status + if val, ok := getImageGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt + if val, ok := getImageGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val } return toSerialize, nil } diff --git a/services/iaas/model_image_checksum.go b/services/iaas/model_image_checksum.go index bfbe73ebf..ed8156792 100644 --- a/services/iaas/model_image_checksum.go +++ b/services/iaas/model_image_checksum.go @@ -17,14 +17,56 @@ import ( // checks if the ImageChecksum type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ImageChecksum{} +/* + types and functions for algorithm +*/ + +// isNotNullableString +type ImageChecksumGetAlgorithmAttributeType = *string + +func getImageChecksumGetAlgorithmAttributeTypeOk(arg ImageChecksumGetAlgorithmAttributeType) (ret ImageChecksumGetAlgorithmRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageChecksumGetAlgorithmAttributeType(arg *ImageChecksumGetAlgorithmAttributeType, val ImageChecksumGetAlgorithmRetType) { + *arg = &val +} + +type ImageChecksumGetAlgorithmArgType = string +type ImageChecksumGetAlgorithmRetType = string + +/* + types and functions for digest +*/ + +// isNotNullableString +type ImageChecksumGetDigestAttributeType = *string + +func getImageChecksumGetDigestAttributeTypeOk(arg ImageChecksumGetDigestAttributeType) (ret ImageChecksumGetDigestRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageChecksumGetDigestAttributeType(arg *ImageChecksumGetDigestAttributeType, val ImageChecksumGetDigestRetType) { + *arg = &val +} + +type ImageChecksumGetDigestArgType = string +type ImageChecksumGetDigestRetType = string + // ImageChecksum Representation of an image checksum. type ImageChecksum struct { // Algorithm for the checksum of the image data. // REQUIRED - Algorithm *string `json:"algorithm"` + Algorithm ImageChecksumGetAlgorithmAttributeType `json:"algorithm"` // Hexdigest of the checksum of the image data. // REQUIRED - Digest *string `json:"digest"` + Digest ImageChecksumGetDigestAttributeType `json:"digest"` } type _ImageChecksum ImageChecksum @@ -33,10 +75,10 @@ type _ImageChecksum ImageChecksum // 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 NewImageChecksum(algorithm *string, digest *string) *ImageChecksum { +func NewImageChecksum(algorithm ImageChecksumGetAlgorithmArgType, digest ImageChecksumGetDigestArgType) *ImageChecksum { this := ImageChecksum{} - this.Algorithm = algorithm - this.Digest = digest + setImageChecksumGetAlgorithmAttributeType(&this.Algorithm, algorithm) + setImageChecksumGetDigestAttributeType(&this.Digest, digest) return &this } @@ -49,57 +91,47 @@ func NewImageChecksumWithDefaults() *ImageChecksum { } // GetAlgorithm returns the Algorithm field value -func (o *ImageChecksum) GetAlgorithm() *string { - if o == nil || IsNil(o.Algorithm) { - var ret *string - return ret - } - - return o.Algorithm +func (o *ImageChecksum) GetAlgorithm() (ret ImageChecksumGetAlgorithmRetType) { + ret, _ = o.GetAlgorithmOk() + return ret } // GetAlgorithmOk returns a tuple with the Algorithm field value // and a boolean to check if the value has been set. -func (o *ImageChecksum) GetAlgorithmOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Algorithm, true +func (o *ImageChecksum) GetAlgorithmOk() (ret ImageChecksumGetAlgorithmRetType, ok bool) { + return getImageChecksumGetAlgorithmAttributeTypeOk(o.Algorithm) } // SetAlgorithm sets field value -func (o *ImageChecksum) SetAlgorithm(v *string) { - o.Algorithm = v +func (o *ImageChecksum) SetAlgorithm(v ImageChecksumGetAlgorithmRetType) { + setImageChecksumGetAlgorithmAttributeType(&o.Algorithm, v) } // GetDigest returns the Digest field value -func (o *ImageChecksum) GetDigest() *string { - if o == nil || IsNil(o.Digest) { - var ret *string - return ret - } - - return o.Digest +func (o *ImageChecksum) GetDigest() (ret ImageChecksumGetDigestRetType) { + ret, _ = o.GetDigestOk() + return ret } // GetDigestOk returns a tuple with the Digest field value // and a boolean to check if the value has been set. -func (o *ImageChecksum) GetDigestOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Digest, true +func (o *ImageChecksum) GetDigestOk() (ret ImageChecksumGetDigestRetType, ok bool) { + return getImageChecksumGetDigestAttributeTypeOk(o.Digest) } // SetDigest sets field value -func (o *ImageChecksum) SetDigest(v *string) { - o.Digest = v +func (o *ImageChecksum) SetDigest(v ImageChecksumGetDigestRetType) { + setImageChecksumGetDigestAttributeType(&o.Digest, v) } func (o ImageChecksum) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["algorithm"] = o.Algorithm - toSerialize["digest"] = o.Digest + if val, ok := getImageChecksumGetAlgorithmAttributeTypeOk(o.Algorithm); ok { + toSerialize["Algorithm"] = val + } + if val, ok := getImageChecksumGetDigestAttributeTypeOk(o.Digest); ok { + toSerialize["Digest"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_image_config.go b/services/iaas/model_image_config.go index 78a974393..110635597 100644 --- a/services/iaas/model_image_config.go +++ b/services/iaas/model_image_config.go @@ -17,36 +17,358 @@ import ( // checks if the ImageConfig type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ImageConfig{} +/* + types and functions for architecture +*/ + +// isNotNullableString +type ImageConfigGetArchitectureAttributeType = *string + +func getImageConfigGetArchitectureAttributeTypeOk(arg ImageConfigGetArchitectureAttributeType) (ret ImageConfigGetArchitectureRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageConfigGetArchitectureAttributeType(arg *ImageConfigGetArchitectureAttributeType, val ImageConfigGetArchitectureRetType) { + *arg = &val +} + +type ImageConfigGetArchitectureArgType = string +type ImageConfigGetArchitectureRetType = string + +/* + types and functions for bootMenu +*/ + +// isBoolean +type ImageConfiggetBootMenuAttributeType = *bool +type ImageConfiggetBootMenuArgType = bool +type ImageConfiggetBootMenuRetType = bool + +func getImageConfiggetBootMenuAttributeTypeOk(arg ImageConfiggetBootMenuAttributeType) (ret ImageConfiggetBootMenuRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageConfiggetBootMenuAttributeType(arg *ImageConfiggetBootMenuAttributeType, val ImageConfiggetBootMenuRetType) { + *arg = &val +} + +/* + types and functions for cdromBus +*/ + +// isNullableString +type ImageConfigGetCdromBusAttributeType = *NullableString + +func getImageConfigGetCdromBusAttributeTypeOk(arg ImageConfigGetCdromBusAttributeType) (ret ImageConfigGetCdromBusRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setImageConfigGetCdromBusAttributeType(arg *ImageConfigGetCdromBusAttributeType, val ImageConfigGetCdromBusRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type ImageConfigGetCdromBusArgType = *string +type ImageConfigGetCdromBusRetType = *string + +/* + types and functions for diskBus +*/ + +// isNullableString +type ImageConfigGetDiskBusAttributeType = *NullableString + +func getImageConfigGetDiskBusAttributeTypeOk(arg ImageConfigGetDiskBusAttributeType) (ret ImageConfigGetDiskBusRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setImageConfigGetDiskBusAttributeType(arg *ImageConfigGetDiskBusAttributeType, val ImageConfigGetDiskBusRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type ImageConfigGetDiskBusArgType = *string +type ImageConfigGetDiskBusRetType = *string + +/* + types and functions for nicModel +*/ + +// isNullableString +type ImageConfigGetNicModelAttributeType = *NullableString + +func getImageConfigGetNicModelAttributeTypeOk(arg ImageConfigGetNicModelAttributeType) (ret ImageConfigGetNicModelRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setImageConfigGetNicModelAttributeType(arg *ImageConfigGetNicModelAttributeType, val ImageConfigGetNicModelRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type ImageConfigGetNicModelArgType = *string +type ImageConfigGetNicModelRetType = *string + +/* + types and functions for operatingSystem +*/ + +// isNotNullableString +type ImageConfigGetOperatingSystemAttributeType = *string + +func getImageConfigGetOperatingSystemAttributeTypeOk(arg ImageConfigGetOperatingSystemAttributeType) (ret ImageConfigGetOperatingSystemRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageConfigGetOperatingSystemAttributeType(arg *ImageConfigGetOperatingSystemAttributeType, val ImageConfigGetOperatingSystemRetType) { + *arg = &val +} + +type ImageConfigGetOperatingSystemArgType = string +type ImageConfigGetOperatingSystemRetType = string + +/* + types and functions for operatingSystemDistro +*/ + +// isNullableString +type ImageConfigGetOperatingSystemDistroAttributeType = *NullableString + +func getImageConfigGetOperatingSystemDistroAttributeTypeOk(arg ImageConfigGetOperatingSystemDistroAttributeType) (ret ImageConfigGetOperatingSystemDistroRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setImageConfigGetOperatingSystemDistroAttributeType(arg *ImageConfigGetOperatingSystemDistroAttributeType, val ImageConfigGetOperatingSystemDistroRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type ImageConfigGetOperatingSystemDistroArgType = *string +type ImageConfigGetOperatingSystemDistroRetType = *string + +/* + types and functions for operatingSystemVersion +*/ + +// isNullableString +type ImageConfigGetOperatingSystemVersionAttributeType = *NullableString + +func getImageConfigGetOperatingSystemVersionAttributeTypeOk(arg ImageConfigGetOperatingSystemVersionAttributeType) (ret ImageConfigGetOperatingSystemVersionRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setImageConfigGetOperatingSystemVersionAttributeType(arg *ImageConfigGetOperatingSystemVersionAttributeType, val ImageConfigGetOperatingSystemVersionRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type ImageConfigGetOperatingSystemVersionArgType = *string +type ImageConfigGetOperatingSystemVersionRetType = *string + +/* + types and functions for rescueBus +*/ + +// isNullableString +type ImageConfigGetRescueBusAttributeType = *NullableString + +func getImageConfigGetRescueBusAttributeTypeOk(arg ImageConfigGetRescueBusAttributeType) (ret ImageConfigGetRescueBusRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setImageConfigGetRescueBusAttributeType(arg *ImageConfigGetRescueBusAttributeType, val ImageConfigGetRescueBusRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type ImageConfigGetRescueBusArgType = *string +type ImageConfigGetRescueBusRetType = *string + +/* + types and functions for rescueDevice +*/ + +// isNullableString +type ImageConfigGetRescueDeviceAttributeType = *NullableString + +func getImageConfigGetRescueDeviceAttributeTypeOk(arg ImageConfigGetRescueDeviceAttributeType) (ret ImageConfigGetRescueDeviceRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setImageConfigGetRescueDeviceAttributeType(arg *ImageConfigGetRescueDeviceAttributeType, val ImageConfigGetRescueDeviceRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type ImageConfigGetRescueDeviceArgType = *string +type ImageConfigGetRescueDeviceRetType = *string + +/* + types and functions for secureBoot +*/ + +// isBoolean +type ImageConfiggetSecureBootAttributeType = *bool +type ImageConfiggetSecureBootArgType = bool +type ImageConfiggetSecureBootRetType = bool + +func getImageConfiggetSecureBootAttributeTypeOk(arg ImageConfiggetSecureBootAttributeType) (ret ImageConfiggetSecureBootRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageConfiggetSecureBootAttributeType(arg *ImageConfiggetSecureBootAttributeType, val ImageConfiggetSecureBootRetType) { + *arg = &val +} + +/* + types and functions for uefi +*/ + +// isBoolean +type ImageConfiggetUefiAttributeType = *bool +type ImageConfiggetUefiArgType = bool +type ImageConfiggetUefiRetType = bool + +func getImageConfiggetUefiAttributeTypeOk(arg ImageConfiggetUefiAttributeType) (ret ImageConfiggetUefiRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageConfiggetUefiAttributeType(arg *ImageConfiggetUefiAttributeType, val ImageConfiggetUefiRetType) { + *arg = &val +} + +/* + types and functions for videoModel +*/ + +// isNullableString +type ImageConfigGetVideoModelAttributeType = *NullableString + +func getImageConfigGetVideoModelAttributeTypeOk(arg ImageConfigGetVideoModelAttributeType) (ret ImageConfigGetVideoModelRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setImageConfigGetVideoModelAttributeType(arg *ImageConfigGetVideoModelAttributeType, val ImageConfigGetVideoModelRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type ImageConfigGetVideoModelArgType = *string +type ImageConfigGetVideoModelRetType = *string + +/* + types and functions for virtioScsi +*/ + +// isBoolean +type ImageConfiggetVirtioScsiAttributeType = *bool +type ImageConfiggetVirtioScsiArgType = bool +type ImageConfiggetVirtioScsiRetType = bool + +func getImageConfiggetVirtioScsiAttributeTypeOk(arg ImageConfiggetVirtioScsiAttributeType) (ret ImageConfiggetVirtioScsiRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageConfiggetVirtioScsiAttributeType(arg *ImageConfiggetVirtioScsiAttributeType, val ImageConfiggetVirtioScsiRetType) { + *arg = &val +} + // ImageConfig Properties to set hardware and scheduling settings for an Image. type ImageConfig struct { // Represents CPU architecture. The default for new images is x86. - Architecture *string `json:"architecture,omitempty"` + Architecture ImageConfigGetArchitectureAttributeType `json:"architecture,omitempty"` // Enables the BIOS bootmenu. The default for new images is disabled. - BootMenu *bool `json:"bootMenu,omitempty"` + BootMenu ImageConfiggetBootMenuAttributeType `json:"bootMenu,omitempty"` // Sets CDROM bus controller type. - CdromBus *NullableString `json:"cdromBus,omitempty"` + CdromBus ImageConfigGetCdromBusAttributeType `json:"cdromBus,omitempty"` // Sets Disk bus controller type. - DiskBus *NullableString `json:"diskBus,omitempty"` + DiskBus ImageConfigGetDiskBusAttributeType `json:"diskBus,omitempty"` // Sets virtual nic model. - NicModel *NullableString `json:"nicModel,omitempty"` + NicModel ImageConfigGetNicModelAttributeType `json:"nicModel,omitempty"` // Enables OS specific optimizations. - OperatingSystem *string `json:"operatingSystem,omitempty"` + OperatingSystem ImageConfigGetOperatingSystemAttributeType `json:"operatingSystem,omitempty"` // Operating System Distribution. - OperatingSystemDistro *NullableString `json:"operatingSystemDistro,omitempty"` + OperatingSystemDistro ImageConfigGetOperatingSystemDistroAttributeType `json:"operatingSystemDistro,omitempty"` // Version of the OS. - OperatingSystemVersion *NullableString `json:"operatingSystemVersion,omitempty"` + OperatingSystemVersion ImageConfigGetOperatingSystemVersionAttributeType `json:"operatingSystemVersion,omitempty"` // Sets the device bus when the image is used as a rescue image. - RescueBus *NullableString `json:"rescueBus,omitempty"` + RescueBus ImageConfigGetRescueBusAttributeType `json:"rescueBus,omitempty"` // Sets the device when the image is used as a rescue image. - RescueDevice *NullableString `json:"rescueDevice,omitempty"` + RescueDevice ImageConfigGetRescueDeviceAttributeType `json:"rescueDevice,omitempty"` // Enables Secure Boot. The default for new images is disabled. - SecureBoot *bool `json:"secureBoot,omitempty"` + SecureBoot ImageConfiggetSecureBootAttributeType `json:"secureBoot,omitempty"` // Configure UEFI boot. The default for new images is enabled. - Uefi *bool `json:"uefi,omitempty"` + Uefi ImageConfiggetUefiAttributeType `json:"uefi,omitempty"` // Sets Graphic device model. - VideoModel *NullableString `json:"videoModel,omitempty"` + VideoModel ImageConfigGetVideoModelAttributeType `json:"videoModel,omitempty"` // Enables the use of VirtIO SCSI to provide block device access. By default servers use VirtIO Block. - VirtioScsi *bool `json:"virtioScsi,omitempty"` + VirtioScsi ImageConfiggetVirtioScsiAttributeType `json:"virtioScsi,omitempty"` } // NewImageConfig instantiates a new ImageConfig object @@ -67,656 +389,458 @@ func NewImageConfigWithDefaults() *ImageConfig { } // GetArchitecture returns the Architecture field value if set, zero value otherwise. -func (o *ImageConfig) GetArchitecture() *string { - if o == nil || IsNil(o.Architecture) { - var ret *string - return ret - } - return o.Architecture +func (o *ImageConfig) GetArchitecture() (res ImageConfigGetArchitectureRetType) { + res, _ = o.GetArchitectureOk() + return } // GetArchitectureOk returns a tuple with the Architecture field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ImageConfig) GetArchitectureOk() (*string, bool) { - if o == nil || IsNil(o.Architecture) { - return nil, false - } - return o.Architecture, true +func (o *ImageConfig) GetArchitectureOk() (ret ImageConfigGetArchitectureRetType, ok bool) { + return getImageConfigGetArchitectureAttributeTypeOk(o.Architecture) } // HasArchitecture returns a boolean if a field has been set. func (o *ImageConfig) HasArchitecture() bool { - if o != nil && !IsNil(o.Architecture) { - return true - } - - return false + _, ok := o.GetArchitectureOk() + return ok } // SetArchitecture gets a reference to the given string and assigns it to the Architecture field. -func (o *ImageConfig) SetArchitecture(v *string) { - o.Architecture = v +func (o *ImageConfig) SetArchitecture(v ImageConfigGetArchitectureRetType) { + setImageConfigGetArchitectureAttributeType(&o.Architecture, v) } // GetBootMenu returns the BootMenu field value if set, zero value otherwise. -func (o *ImageConfig) GetBootMenu() *bool { - if o == nil || IsNil(o.BootMenu) { - var ret *bool - return ret - } - return o.BootMenu +func (o *ImageConfig) GetBootMenu() (res ImageConfiggetBootMenuRetType) { + res, _ = o.GetBootMenuOk() + return } // GetBootMenuOk returns a tuple with the BootMenu field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ImageConfig) GetBootMenuOk() (*bool, bool) { - if o == nil || IsNil(o.BootMenu) { - return nil, false - } - return o.BootMenu, true +func (o *ImageConfig) GetBootMenuOk() (ret ImageConfiggetBootMenuRetType, ok bool) { + return getImageConfiggetBootMenuAttributeTypeOk(o.BootMenu) } // HasBootMenu returns a boolean if a field has been set. func (o *ImageConfig) HasBootMenu() bool { - if o != nil && !IsNil(o.BootMenu) { - return true - } - - return false + _, ok := o.GetBootMenuOk() + return ok } // SetBootMenu gets a reference to the given bool and assigns it to the BootMenu field. -func (o *ImageConfig) SetBootMenu(v *bool) { - o.BootMenu = v +func (o *ImageConfig) SetBootMenu(v ImageConfiggetBootMenuRetType) { + setImageConfiggetBootMenuAttributeType(&o.BootMenu, v) } // GetCdromBus returns the CdromBus field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ImageConfig) GetCdromBus() *string { - if o == nil || IsNil(o.CdromBus) || IsNil(o.CdromBus.Get()) { - var ret *string - return ret - } - return o.CdromBus.Get() +func (o *ImageConfig) GetCdromBus() (res ImageConfigGetCdromBusRetType) { + res, _ = o.GetCdromBusOk() + return } // GetCdromBusOk returns a tuple with the CdromBus field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ImageConfig) GetCdromBusOk() (*string, bool) { - if o == nil || IsNil(o.CdromBus) { - return nil, false - } - return o.CdromBus.Get(), o.CdromBus.IsSet() +func (o *ImageConfig) GetCdromBusOk() (ret ImageConfigGetCdromBusRetType, ok bool) { + return getImageConfigGetCdromBusAttributeTypeOk(o.CdromBus) } // HasCdromBus returns a boolean if a field has been set. func (o *ImageConfig) HasCdromBus() bool { - if o != nil && !IsNil(o.CdromBus) && o.CdromBus.IsSet() { - return true - } - - return false + _, ok := o.GetCdromBusOk() + return ok } // SetCdromBus gets a reference to the given string and assigns it to the CdromBus field. -func (o *ImageConfig) SetCdromBus(v *string) { - if IsNil(o.CdromBus) { - o.CdromBus = new(NullableString) - } - o.CdromBus.Set(v) +func (o *ImageConfig) SetCdromBus(v ImageConfigGetCdromBusRetType) { + setImageConfigGetCdromBusAttributeType(&o.CdromBus, v) } // SetCdromBusNil sets the value for CdromBus to be an explicit nil func (o *ImageConfig) SetCdromBusNil() { - if IsNil(o.CdromBus) { - o.CdromBus = new(NullableString) - } - o.CdromBus.Set(nil) + o.CdromBus = nil } // UnsetCdromBus ensures that no value is present for CdromBus, not even an explicit nil func (o *ImageConfig) UnsetCdromBus() { - if IsNil(o.CdromBus) { - o.CdromBus = new(NullableString) - } - o.CdromBus.Unset() + o.CdromBus = nil } // GetDiskBus returns the DiskBus field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ImageConfig) GetDiskBus() *string { - if o == nil || IsNil(o.DiskBus) || IsNil(o.DiskBus.Get()) { - var ret *string - return ret - } - return o.DiskBus.Get() +func (o *ImageConfig) GetDiskBus() (res ImageConfigGetDiskBusRetType) { + res, _ = o.GetDiskBusOk() + return } // GetDiskBusOk returns a tuple with the DiskBus field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ImageConfig) GetDiskBusOk() (*string, bool) { - if o == nil || IsNil(o.DiskBus) { - return nil, false - } - return o.DiskBus.Get(), o.DiskBus.IsSet() +func (o *ImageConfig) GetDiskBusOk() (ret ImageConfigGetDiskBusRetType, ok bool) { + return getImageConfigGetDiskBusAttributeTypeOk(o.DiskBus) } // HasDiskBus returns a boolean if a field has been set. func (o *ImageConfig) HasDiskBus() bool { - if o != nil && !IsNil(o.DiskBus) && o.DiskBus.IsSet() { - return true - } - - return false + _, ok := o.GetDiskBusOk() + return ok } // SetDiskBus gets a reference to the given string and assigns it to the DiskBus field. -func (o *ImageConfig) SetDiskBus(v *string) { - if IsNil(o.DiskBus) { - o.DiskBus = new(NullableString) - } - o.DiskBus.Set(v) +func (o *ImageConfig) SetDiskBus(v ImageConfigGetDiskBusRetType) { + setImageConfigGetDiskBusAttributeType(&o.DiskBus, v) } // SetDiskBusNil sets the value for DiskBus to be an explicit nil func (o *ImageConfig) SetDiskBusNil() { - if IsNil(o.DiskBus) { - o.DiskBus = new(NullableString) - } - o.DiskBus.Set(nil) + o.DiskBus = nil } // UnsetDiskBus ensures that no value is present for DiskBus, not even an explicit nil func (o *ImageConfig) UnsetDiskBus() { - if IsNil(o.DiskBus) { - o.DiskBus = new(NullableString) - } - o.DiskBus.Unset() + o.DiskBus = nil } // GetNicModel returns the NicModel field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ImageConfig) GetNicModel() *string { - if o == nil || IsNil(o.NicModel) || IsNil(o.NicModel.Get()) { - var ret *string - return ret - } - return o.NicModel.Get() +func (o *ImageConfig) GetNicModel() (res ImageConfigGetNicModelRetType) { + res, _ = o.GetNicModelOk() + return } // GetNicModelOk returns a tuple with the NicModel field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ImageConfig) GetNicModelOk() (*string, bool) { - if o == nil || IsNil(o.NicModel) { - return nil, false - } - return o.NicModel.Get(), o.NicModel.IsSet() +func (o *ImageConfig) GetNicModelOk() (ret ImageConfigGetNicModelRetType, ok bool) { + return getImageConfigGetNicModelAttributeTypeOk(o.NicModel) } // HasNicModel returns a boolean if a field has been set. func (o *ImageConfig) HasNicModel() bool { - if o != nil && !IsNil(o.NicModel) && o.NicModel.IsSet() { - return true - } - - return false + _, ok := o.GetNicModelOk() + return ok } // SetNicModel gets a reference to the given string and assigns it to the NicModel field. -func (o *ImageConfig) SetNicModel(v *string) { - if IsNil(o.NicModel) { - o.NicModel = new(NullableString) - } - o.NicModel.Set(v) +func (o *ImageConfig) SetNicModel(v ImageConfigGetNicModelRetType) { + setImageConfigGetNicModelAttributeType(&o.NicModel, v) } // SetNicModelNil sets the value for NicModel to be an explicit nil func (o *ImageConfig) SetNicModelNil() { - if IsNil(o.NicModel) { - o.NicModel = new(NullableString) - } - o.NicModel.Set(nil) + o.NicModel = nil } // UnsetNicModel ensures that no value is present for NicModel, not even an explicit nil func (o *ImageConfig) UnsetNicModel() { - if IsNil(o.NicModel) { - o.NicModel = new(NullableString) - } - o.NicModel.Unset() + o.NicModel = nil } // GetOperatingSystem returns the OperatingSystem field value if set, zero value otherwise. -func (o *ImageConfig) GetOperatingSystem() *string { - if o == nil || IsNil(o.OperatingSystem) { - var ret *string - return ret - } - return o.OperatingSystem +func (o *ImageConfig) GetOperatingSystem() (res ImageConfigGetOperatingSystemRetType) { + res, _ = o.GetOperatingSystemOk() + return } // GetOperatingSystemOk returns a tuple with the OperatingSystem field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ImageConfig) GetOperatingSystemOk() (*string, bool) { - if o == nil || IsNil(o.OperatingSystem) { - return nil, false - } - return o.OperatingSystem, true +func (o *ImageConfig) GetOperatingSystemOk() (ret ImageConfigGetOperatingSystemRetType, ok bool) { + return getImageConfigGetOperatingSystemAttributeTypeOk(o.OperatingSystem) } // HasOperatingSystem returns a boolean if a field has been set. func (o *ImageConfig) HasOperatingSystem() bool { - if o != nil && !IsNil(o.OperatingSystem) { - return true - } - - return false + _, ok := o.GetOperatingSystemOk() + return ok } // SetOperatingSystem gets a reference to the given string and assigns it to the OperatingSystem field. -func (o *ImageConfig) SetOperatingSystem(v *string) { - o.OperatingSystem = v +func (o *ImageConfig) SetOperatingSystem(v ImageConfigGetOperatingSystemRetType) { + setImageConfigGetOperatingSystemAttributeType(&o.OperatingSystem, v) } // GetOperatingSystemDistro returns the OperatingSystemDistro field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ImageConfig) GetOperatingSystemDistro() *string { - if o == nil || IsNil(o.OperatingSystemDistro) || IsNil(o.OperatingSystemDistro.Get()) { - var ret *string - return ret - } - return o.OperatingSystemDistro.Get() +func (o *ImageConfig) GetOperatingSystemDistro() (res ImageConfigGetOperatingSystemDistroRetType) { + res, _ = o.GetOperatingSystemDistroOk() + return } // GetOperatingSystemDistroOk returns a tuple with the OperatingSystemDistro field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ImageConfig) GetOperatingSystemDistroOk() (*string, bool) { - if o == nil || IsNil(o.OperatingSystemDistro) { - return nil, false - } - return o.OperatingSystemDistro.Get(), o.OperatingSystemDistro.IsSet() +func (o *ImageConfig) GetOperatingSystemDistroOk() (ret ImageConfigGetOperatingSystemDistroRetType, ok bool) { + return getImageConfigGetOperatingSystemDistroAttributeTypeOk(o.OperatingSystemDistro) } // HasOperatingSystemDistro returns a boolean if a field has been set. func (o *ImageConfig) HasOperatingSystemDistro() bool { - if o != nil && !IsNil(o.OperatingSystemDistro) && o.OperatingSystemDistro.IsSet() { - return true - } - - return false + _, ok := o.GetOperatingSystemDistroOk() + return ok } // SetOperatingSystemDistro gets a reference to the given string and assigns it to the OperatingSystemDistro field. -func (o *ImageConfig) SetOperatingSystemDistro(v *string) { - if IsNil(o.OperatingSystemDistro) { - o.OperatingSystemDistro = new(NullableString) - } - o.OperatingSystemDistro.Set(v) +func (o *ImageConfig) SetOperatingSystemDistro(v ImageConfigGetOperatingSystemDistroRetType) { + setImageConfigGetOperatingSystemDistroAttributeType(&o.OperatingSystemDistro, v) } // SetOperatingSystemDistroNil sets the value for OperatingSystemDistro to be an explicit nil func (o *ImageConfig) SetOperatingSystemDistroNil() { - if IsNil(o.OperatingSystemDistro) { - o.OperatingSystemDistro = new(NullableString) - } - o.OperatingSystemDistro.Set(nil) + o.OperatingSystemDistro = nil } // UnsetOperatingSystemDistro ensures that no value is present for OperatingSystemDistro, not even an explicit nil func (o *ImageConfig) UnsetOperatingSystemDistro() { - if IsNil(o.OperatingSystemDistro) { - o.OperatingSystemDistro = new(NullableString) - } - o.OperatingSystemDistro.Unset() + o.OperatingSystemDistro = nil } // GetOperatingSystemVersion returns the OperatingSystemVersion field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ImageConfig) GetOperatingSystemVersion() *string { - if o == nil || IsNil(o.OperatingSystemVersion) || IsNil(o.OperatingSystemVersion.Get()) { - var ret *string - return ret - } - return o.OperatingSystemVersion.Get() +func (o *ImageConfig) GetOperatingSystemVersion() (res ImageConfigGetOperatingSystemVersionRetType) { + res, _ = o.GetOperatingSystemVersionOk() + return } // GetOperatingSystemVersionOk returns a tuple with the OperatingSystemVersion field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ImageConfig) GetOperatingSystemVersionOk() (*string, bool) { - if o == nil || IsNil(o.OperatingSystemVersion) { - return nil, false - } - return o.OperatingSystemVersion.Get(), o.OperatingSystemVersion.IsSet() +func (o *ImageConfig) GetOperatingSystemVersionOk() (ret ImageConfigGetOperatingSystemVersionRetType, ok bool) { + return getImageConfigGetOperatingSystemVersionAttributeTypeOk(o.OperatingSystemVersion) } // HasOperatingSystemVersion returns a boolean if a field has been set. func (o *ImageConfig) HasOperatingSystemVersion() bool { - if o != nil && !IsNil(o.OperatingSystemVersion) && o.OperatingSystemVersion.IsSet() { - return true - } - - return false + _, ok := o.GetOperatingSystemVersionOk() + return ok } // SetOperatingSystemVersion gets a reference to the given string and assigns it to the OperatingSystemVersion field. -func (o *ImageConfig) SetOperatingSystemVersion(v *string) { - if IsNil(o.OperatingSystemVersion) { - o.OperatingSystemVersion = new(NullableString) - } - o.OperatingSystemVersion.Set(v) +func (o *ImageConfig) SetOperatingSystemVersion(v ImageConfigGetOperatingSystemVersionRetType) { + setImageConfigGetOperatingSystemVersionAttributeType(&o.OperatingSystemVersion, v) } // SetOperatingSystemVersionNil sets the value for OperatingSystemVersion to be an explicit nil func (o *ImageConfig) SetOperatingSystemVersionNil() { - if IsNil(o.OperatingSystemVersion) { - o.OperatingSystemVersion = new(NullableString) - } - o.OperatingSystemVersion.Set(nil) + o.OperatingSystemVersion = nil } // UnsetOperatingSystemVersion ensures that no value is present for OperatingSystemVersion, not even an explicit nil func (o *ImageConfig) UnsetOperatingSystemVersion() { - if IsNil(o.OperatingSystemVersion) { - o.OperatingSystemVersion = new(NullableString) - } - o.OperatingSystemVersion.Unset() + o.OperatingSystemVersion = nil } // GetRescueBus returns the RescueBus field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ImageConfig) GetRescueBus() *string { - if o == nil || IsNil(o.RescueBus) || IsNil(o.RescueBus.Get()) { - var ret *string - return ret - } - return o.RescueBus.Get() +func (o *ImageConfig) GetRescueBus() (res ImageConfigGetRescueBusRetType) { + res, _ = o.GetRescueBusOk() + return } // GetRescueBusOk returns a tuple with the RescueBus field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ImageConfig) GetRescueBusOk() (*string, bool) { - if o == nil || IsNil(o.RescueBus) { - return nil, false - } - return o.RescueBus.Get(), o.RescueBus.IsSet() +func (o *ImageConfig) GetRescueBusOk() (ret ImageConfigGetRescueBusRetType, ok bool) { + return getImageConfigGetRescueBusAttributeTypeOk(o.RescueBus) } // HasRescueBus returns a boolean if a field has been set. func (o *ImageConfig) HasRescueBus() bool { - if o != nil && !IsNil(o.RescueBus) && o.RescueBus.IsSet() { - return true - } - - return false + _, ok := o.GetRescueBusOk() + return ok } // SetRescueBus gets a reference to the given string and assigns it to the RescueBus field. -func (o *ImageConfig) SetRescueBus(v *string) { - if IsNil(o.RescueBus) { - o.RescueBus = new(NullableString) - } - o.RescueBus.Set(v) +func (o *ImageConfig) SetRescueBus(v ImageConfigGetRescueBusRetType) { + setImageConfigGetRescueBusAttributeType(&o.RescueBus, v) } // SetRescueBusNil sets the value for RescueBus to be an explicit nil func (o *ImageConfig) SetRescueBusNil() { - if IsNil(o.RescueBus) { - o.RescueBus = new(NullableString) - } - o.RescueBus.Set(nil) + o.RescueBus = nil } // UnsetRescueBus ensures that no value is present for RescueBus, not even an explicit nil func (o *ImageConfig) UnsetRescueBus() { - if IsNil(o.RescueBus) { - o.RescueBus = new(NullableString) - } - o.RescueBus.Unset() + o.RescueBus = nil } // GetRescueDevice returns the RescueDevice field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ImageConfig) GetRescueDevice() *string { - if o == nil || IsNil(o.RescueDevice) || IsNil(o.RescueDevice.Get()) { - var ret *string - return ret - } - return o.RescueDevice.Get() +func (o *ImageConfig) GetRescueDevice() (res ImageConfigGetRescueDeviceRetType) { + res, _ = o.GetRescueDeviceOk() + return } // GetRescueDeviceOk returns a tuple with the RescueDevice field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ImageConfig) GetRescueDeviceOk() (*string, bool) { - if o == nil || IsNil(o.RescueDevice) { - return nil, false - } - return o.RescueDevice.Get(), o.RescueDevice.IsSet() +func (o *ImageConfig) GetRescueDeviceOk() (ret ImageConfigGetRescueDeviceRetType, ok bool) { + return getImageConfigGetRescueDeviceAttributeTypeOk(o.RescueDevice) } // HasRescueDevice returns a boolean if a field has been set. func (o *ImageConfig) HasRescueDevice() bool { - if o != nil && !IsNil(o.RescueDevice) && o.RescueDevice.IsSet() { - return true - } - - return false + _, ok := o.GetRescueDeviceOk() + return ok } // SetRescueDevice gets a reference to the given string and assigns it to the RescueDevice field. -func (o *ImageConfig) SetRescueDevice(v *string) { - if IsNil(o.RescueDevice) { - o.RescueDevice = new(NullableString) - } - o.RescueDevice.Set(v) +func (o *ImageConfig) SetRescueDevice(v ImageConfigGetRescueDeviceRetType) { + setImageConfigGetRescueDeviceAttributeType(&o.RescueDevice, v) } // SetRescueDeviceNil sets the value for RescueDevice to be an explicit nil func (o *ImageConfig) SetRescueDeviceNil() { - if IsNil(o.RescueDevice) { - o.RescueDevice = new(NullableString) - } - o.RescueDevice.Set(nil) + o.RescueDevice = nil } // UnsetRescueDevice ensures that no value is present for RescueDevice, not even an explicit nil func (o *ImageConfig) UnsetRescueDevice() { - if IsNil(o.RescueDevice) { - o.RescueDevice = new(NullableString) - } - o.RescueDevice.Unset() + o.RescueDevice = nil } // GetSecureBoot returns the SecureBoot field value if set, zero value otherwise. -func (o *ImageConfig) GetSecureBoot() *bool { - if o == nil || IsNil(o.SecureBoot) { - var ret *bool - return ret - } - return o.SecureBoot +func (o *ImageConfig) GetSecureBoot() (res ImageConfiggetSecureBootRetType) { + res, _ = o.GetSecureBootOk() + return } // GetSecureBootOk returns a tuple with the SecureBoot field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ImageConfig) GetSecureBootOk() (*bool, bool) { - if o == nil || IsNil(o.SecureBoot) { - return nil, false - } - return o.SecureBoot, true +func (o *ImageConfig) GetSecureBootOk() (ret ImageConfiggetSecureBootRetType, ok bool) { + return getImageConfiggetSecureBootAttributeTypeOk(o.SecureBoot) } // HasSecureBoot returns a boolean if a field has been set. func (o *ImageConfig) HasSecureBoot() bool { - if o != nil && !IsNil(o.SecureBoot) { - return true - } - - return false + _, ok := o.GetSecureBootOk() + return ok } // SetSecureBoot gets a reference to the given bool and assigns it to the SecureBoot field. -func (o *ImageConfig) SetSecureBoot(v *bool) { - o.SecureBoot = v +func (o *ImageConfig) SetSecureBoot(v ImageConfiggetSecureBootRetType) { + setImageConfiggetSecureBootAttributeType(&o.SecureBoot, v) } // GetUefi returns the Uefi field value if set, zero value otherwise. -func (o *ImageConfig) GetUefi() *bool { - if o == nil || IsNil(o.Uefi) { - var ret *bool - return ret - } - return o.Uefi +func (o *ImageConfig) GetUefi() (res ImageConfiggetUefiRetType) { + res, _ = o.GetUefiOk() + return } // GetUefiOk returns a tuple with the Uefi field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ImageConfig) GetUefiOk() (*bool, bool) { - if o == nil || IsNil(o.Uefi) { - return nil, false - } - return o.Uefi, true +func (o *ImageConfig) GetUefiOk() (ret ImageConfiggetUefiRetType, ok bool) { + return getImageConfiggetUefiAttributeTypeOk(o.Uefi) } // HasUefi returns a boolean if a field has been set. func (o *ImageConfig) HasUefi() bool { - if o != nil && !IsNil(o.Uefi) { - return true - } - - return false + _, ok := o.GetUefiOk() + return ok } // SetUefi gets a reference to the given bool and assigns it to the Uefi field. -func (o *ImageConfig) SetUefi(v *bool) { - o.Uefi = v +func (o *ImageConfig) SetUefi(v ImageConfiggetUefiRetType) { + setImageConfiggetUefiAttributeType(&o.Uefi, v) } // GetVideoModel returns the VideoModel field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ImageConfig) GetVideoModel() *string { - if o == nil || IsNil(o.VideoModel) || IsNil(o.VideoModel.Get()) { - var ret *string - return ret - } - return o.VideoModel.Get() +func (o *ImageConfig) GetVideoModel() (res ImageConfigGetVideoModelRetType) { + res, _ = o.GetVideoModelOk() + return } // GetVideoModelOk returns a tuple with the VideoModel field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ImageConfig) GetVideoModelOk() (*string, bool) { - if o == nil || IsNil(o.VideoModel) { - return nil, false - } - return o.VideoModel.Get(), o.VideoModel.IsSet() +func (o *ImageConfig) GetVideoModelOk() (ret ImageConfigGetVideoModelRetType, ok bool) { + return getImageConfigGetVideoModelAttributeTypeOk(o.VideoModel) } // HasVideoModel returns a boolean if a field has been set. func (o *ImageConfig) HasVideoModel() bool { - if o != nil && !IsNil(o.VideoModel) && o.VideoModel.IsSet() { - return true - } - - return false + _, ok := o.GetVideoModelOk() + return ok } // SetVideoModel gets a reference to the given string and assigns it to the VideoModel field. -func (o *ImageConfig) SetVideoModel(v *string) { - if IsNil(o.VideoModel) { - o.VideoModel = new(NullableString) - } - o.VideoModel.Set(v) +func (o *ImageConfig) SetVideoModel(v ImageConfigGetVideoModelRetType) { + setImageConfigGetVideoModelAttributeType(&o.VideoModel, v) } // SetVideoModelNil sets the value for VideoModel to be an explicit nil func (o *ImageConfig) SetVideoModelNil() { - if IsNil(o.VideoModel) { - o.VideoModel = new(NullableString) - } - o.VideoModel.Set(nil) + o.VideoModel = nil } // UnsetVideoModel ensures that no value is present for VideoModel, not even an explicit nil func (o *ImageConfig) UnsetVideoModel() { - if IsNil(o.VideoModel) { - o.VideoModel = new(NullableString) - } - o.VideoModel.Unset() + o.VideoModel = nil } // GetVirtioScsi returns the VirtioScsi field value if set, zero value otherwise. -func (o *ImageConfig) GetVirtioScsi() *bool { - if o == nil || IsNil(o.VirtioScsi) { - var ret *bool - return ret - } - return o.VirtioScsi +func (o *ImageConfig) GetVirtioScsi() (res ImageConfiggetVirtioScsiRetType) { + res, _ = o.GetVirtioScsiOk() + return } // GetVirtioScsiOk returns a tuple with the VirtioScsi field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ImageConfig) GetVirtioScsiOk() (*bool, bool) { - if o == nil || IsNil(o.VirtioScsi) { - return nil, false - } - return o.VirtioScsi, true +func (o *ImageConfig) GetVirtioScsiOk() (ret ImageConfiggetVirtioScsiRetType, ok bool) { + return getImageConfiggetVirtioScsiAttributeTypeOk(o.VirtioScsi) } // HasVirtioScsi returns a boolean if a field has been set. func (o *ImageConfig) HasVirtioScsi() bool { - if o != nil && !IsNil(o.VirtioScsi) { - return true - } - - return false + _, ok := o.GetVirtioScsiOk() + return ok } // SetVirtioScsi gets a reference to the given bool and assigns it to the VirtioScsi field. -func (o *ImageConfig) SetVirtioScsi(v *bool) { - o.VirtioScsi = v +func (o *ImageConfig) SetVirtioScsi(v ImageConfiggetVirtioScsiRetType) { + setImageConfiggetVirtioScsiAttributeType(&o.VirtioScsi, v) } func (o ImageConfig) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Architecture) { - toSerialize["architecture"] = o.Architecture + if val, ok := getImageConfigGetArchitectureAttributeTypeOk(o.Architecture); ok { + toSerialize["Architecture"] = val } - if !IsNil(o.BootMenu) { - toSerialize["bootMenu"] = o.BootMenu + if val, ok := getImageConfiggetBootMenuAttributeTypeOk(o.BootMenu); ok { + toSerialize["BootMenu"] = val } - if o.CdromBus.IsSet() { - toSerialize["cdromBus"] = o.CdromBus.Get() + if val, ok := getImageConfigGetCdromBusAttributeTypeOk(o.CdromBus); ok { + toSerialize["CdromBus"] = val } - if o.DiskBus.IsSet() { - toSerialize["diskBus"] = o.DiskBus.Get() + if val, ok := getImageConfigGetDiskBusAttributeTypeOk(o.DiskBus); ok { + toSerialize["DiskBus"] = val } - if o.NicModel.IsSet() { - toSerialize["nicModel"] = o.NicModel.Get() + if val, ok := getImageConfigGetNicModelAttributeTypeOk(o.NicModel); ok { + toSerialize["NicModel"] = val } - if !IsNil(o.OperatingSystem) { - toSerialize["operatingSystem"] = o.OperatingSystem + if val, ok := getImageConfigGetOperatingSystemAttributeTypeOk(o.OperatingSystem); ok { + toSerialize["OperatingSystem"] = val } - if o.OperatingSystemDistro.IsSet() { - toSerialize["operatingSystemDistro"] = o.OperatingSystemDistro.Get() + if val, ok := getImageConfigGetOperatingSystemDistroAttributeTypeOk(o.OperatingSystemDistro); ok { + toSerialize["OperatingSystemDistro"] = val } - if o.OperatingSystemVersion.IsSet() { - toSerialize["operatingSystemVersion"] = o.OperatingSystemVersion.Get() + if val, ok := getImageConfigGetOperatingSystemVersionAttributeTypeOk(o.OperatingSystemVersion); ok { + toSerialize["OperatingSystemVersion"] = val } - if o.RescueBus.IsSet() { - toSerialize["rescueBus"] = o.RescueBus.Get() + if val, ok := getImageConfigGetRescueBusAttributeTypeOk(o.RescueBus); ok { + toSerialize["RescueBus"] = val } - if o.RescueDevice.IsSet() { - toSerialize["rescueDevice"] = o.RescueDevice.Get() + if val, ok := getImageConfigGetRescueDeviceAttributeTypeOk(o.RescueDevice); ok { + toSerialize["RescueDevice"] = val } - if !IsNil(o.SecureBoot) { - toSerialize["secureBoot"] = o.SecureBoot + if val, ok := getImageConfiggetSecureBootAttributeTypeOk(o.SecureBoot); ok { + toSerialize["SecureBoot"] = val } - if !IsNil(o.Uefi) { - toSerialize["uefi"] = o.Uefi + if val, ok := getImageConfiggetUefiAttributeTypeOk(o.Uefi); ok { + toSerialize["Uefi"] = val } - if o.VideoModel.IsSet() { - toSerialize["videoModel"] = o.VideoModel.Get() + if val, ok := getImageConfigGetVideoModelAttributeTypeOk(o.VideoModel); ok { + toSerialize["VideoModel"] = val } - if !IsNil(o.VirtioScsi) { - toSerialize["virtioScsi"] = o.VirtioScsi + if val, ok := getImageConfiggetVirtioScsiAttributeTypeOk(o.VirtioScsi); ok { + toSerialize["VirtioScsi"] = val } return toSerialize, nil } diff --git a/services/iaas/model_image_create_response.go b/services/iaas/model_image_create_response.go index bd016053f..0779b56c6 100644 --- a/services/iaas/model_image_create_response.go +++ b/services/iaas/model_image_create_response.go @@ -17,13 +17,55 @@ import ( // checks if the ImageCreateResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ImageCreateResponse{} +/* + types and functions for id +*/ + +// isNotNullableString +type ImageCreateResponseGetIdAttributeType = *string + +func getImageCreateResponseGetIdAttributeTypeOk(arg ImageCreateResponseGetIdAttributeType) (ret ImageCreateResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageCreateResponseGetIdAttributeType(arg *ImageCreateResponseGetIdAttributeType, val ImageCreateResponseGetIdRetType) { + *arg = &val +} + +type ImageCreateResponseGetIdArgType = string +type ImageCreateResponseGetIdRetType = string + +/* + types and functions for uploadUrl +*/ + +// isNotNullableString +type ImageCreateResponseGetUploadUrlAttributeType = *string + +func getImageCreateResponseGetUploadUrlAttributeTypeOk(arg ImageCreateResponseGetUploadUrlAttributeType) (ret ImageCreateResponseGetUploadUrlRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageCreateResponseGetUploadUrlAttributeType(arg *ImageCreateResponseGetUploadUrlAttributeType, val ImageCreateResponseGetUploadUrlRetType) { + *arg = &val +} + +type ImageCreateResponseGetUploadUrlArgType = string +type ImageCreateResponseGetUploadUrlRetType = string + // ImageCreateResponse Image creation response. type ImageCreateResponse struct { // Universally Unique Identifier (UUID). // REQUIRED - Id *string `json:"id"` + Id ImageCreateResponseGetIdAttributeType `json:"id"` // REQUIRED - UploadUrl *string `json:"uploadUrl"` + UploadUrl ImageCreateResponseGetUploadUrlAttributeType `json:"uploadUrl"` } type _ImageCreateResponse ImageCreateResponse @@ -32,10 +74,10 @@ type _ImageCreateResponse ImageCreateResponse // 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 NewImageCreateResponse(id *string, uploadUrl *string) *ImageCreateResponse { +func NewImageCreateResponse(id ImageCreateResponseGetIdArgType, uploadUrl ImageCreateResponseGetUploadUrlArgType) *ImageCreateResponse { this := ImageCreateResponse{} - this.Id = id - this.UploadUrl = uploadUrl + setImageCreateResponseGetIdAttributeType(&this.Id, id) + setImageCreateResponseGetUploadUrlAttributeType(&this.UploadUrl, uploadUrl) return &this } @@ -48,57 +90,47 @@ func NewImageCreateResponseWithDefaults() *ImageCreateResponse { } // GetId returns the Id field value -func (o *ImageCreateResponse) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - - return o.Id +func (o *ImageCreateResponse) GetId() (ret ImageCreateResponseGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *ImageCreateResponse) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *ImageCreateResponse) GetIdOk() (ret ImageCreateResponseGetIdRetType, ok bool) { + return getImageCreateResponseGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *ImageCreateResponse) SetId(v *string) { - o.Id = v +func (o *ImageCreateResponse) SetId(v ImageCreateResponseGetIdRetType) { + setImageCreateResponseGetIdAttributeType(&o.Id, v) } // GetUploadUrl returns the UploadUrl field value -func (o *ImageCreateResponse) GetUploadUrl() *string { - if o == nil || IsNil(o.UploadUrl) { - var ret *string - return ret - } - - return o.UploadUrl +func (o *ImageCreateResponse) GetUploadUrl() (ret ImageCreateResponseGetUploadUrlRetType) { + ret, _ = o.GetUploadUrlOk() + return ret } // GetUploadUrlOk returns a tuple with the UploadUrl field value // and a boolean to check if the value has been set. -func (o *ImageCreateResponse) GetUploadUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.UploadUrl, true +func (o *ImageCreateResponse) GetUploadUrlOk() (ret ImageCreateResponseGetUploadUrlRetType, ok bool) { + return getImageCreateResponseGetUploadUrlAttributeTypeOk(o.UploadUrl) } // SetUploadUrl sets field value -func (o *ImageCreateResponse) SetUploadUrl(v *string) { - o.UploadUrl = v +func (o *ImageCreateResponse) SetUploadUrl(v ImageCreateResponseGetUploadUrlRetType) { + setImageCreateResponseGetUploadUrlAttributeType(&o.UploadUrl, v) } func (o ImageCreateResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["uploadUrl"] = o.UploadUrl + if val, ok := getImageCreateResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getImageCreateResponseGetUploadUrlAttributeTypeOk(o.UploadUrl); ok { + toSerialize["UploadUrl"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_image_list_response.go b/services/iaas/model_image_list_response.go index 13506e806..078633469 100644 --- a/services/iaas/model_image_list_response.go +++ b/services/iaas/model_image_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the ImageListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ImageListResponse{} +/* + types and functions for items +*/ + +// isArray +type ImageListResponseGetItemsAttributeType = *[]Image +type ImageListResponseGetItemsArgType = []Image +type ImageListResponseGetItemsRetType = []Image + +func getImageListResponseGetItemsAttributeTypeOk(arg ImageListResponseGetItemsAttributeType) (ret ImageListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageListResponseGetItemsAttributeType(arg *ImageListResponseGetItemsAttributeType, val ImageListResponseGetItemsRetType) { + *arg = &val +} + // ImageListResponse Image list response. type ImageListResponse struct { // A list containing image objects. // REQUIRED - Items *[]Image `json:"items"` + Items ImageListResponseGetItemsAttributeType `json:"items"` } type _ImageListResponse ImageListResponse @@ -30,9 +50,9 @@ type _ImageListResponse ImageListResponse // 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 NewImageListResponse(items *[]Image) *ImageListResponse { +func NewImageListResponse(items ImageListResponseGetItemsArgType) *ImageListResponse { this := ImageListResponse{} - this.Items = items + setImageListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewImageListResponseWithDefaults() *ImageListResponse { } // GetItems returns the Items field value -func (o *ImageListResponse) GetItems() *[]Image { - if o == nil || IsNil(o.Items) { - var ret *[]Image - return ret - } - - return o.Items +func (o *ImageListResponse) GetItems() (ret ImageListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *ImageListResponse) GetItemsOk() (*[]Image, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *ImageListResponse) GetItemsOk() (ret ImageListResponseGetItemsRetType, ok bool) { + return getImageListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *ImageListResponse) SetItems(v *[]Image) { - o.Items = v +func (o *ImageListResponse) SetItems(v ImageListResponseGetItemsRetType) { + setImageListResponseGetItemsAttributeType(&o.Items, v) } func (o ImageListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getImageListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_image_share.go b/services/iaas/model_image_share.go index 21726d7ae..3689e2b55 100644 --- a/services/iaas/model_image_share.go +++ b/services/iaas/model_image_share.go @@ -17,12 +17,52 @@ import ( // checks if the ImageShare type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ImageShare{} +/* + types and functions for parentOrganization +*/ + +// isBoolean +type ImageSharegetParentOrganizationAttributeType = *bool +type ImageSharegetParentOrganizationArgType = bool +type ImageSharegetParentOrganizationRetType = bool + +func getImageSharegetParentOrganizationAttributeTypeOk(arg ImageSharegetParentOrganizationAttributeType) (ret ImageSharegetParentOrganizationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageSharegetParentOrganizationAttributeType(arg *ImageSharegetParentOrganizationAttributeType, val ImageSharegetParentOrganizationRetType) { + *arg = &val +} + +/* + types and functions for projects +*/ + +// isArray +type ImageShareGetProjectsAttributeType = *[]string +type ImageShareGetProjectsArgType = []string +type ImageShareGetProjectsRetType = []string + +func getImageShareGetProjectsAttributeTypeOk(arg ImageShareGetProjectsAttributeType) (ret ImageShareGetProjectsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageShareGetProjectsAttributeType(arg *ImageShareGetProjectsAttributeType, val ImageShareGetProjectsRetType) { + *arg = &val +} + // ImageShare Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. type ImageShare struct { // Image is shared with all projects inside the image owners organization. - ParentOrganization *bool `json:"parentOrganization,omitempty"` + ParentOrganization ImageSharegetParentOrganizationAttributeType `json:"parentOrganization,omitempty"` // List of all projects the Image is shared with. - Projects *[]string `json:"projects,omitempty"` + Projects ImageShareGetProjectsAttributeType `json:"projects,omitempty"` } // NewImageShare instantiates a new ImageShare object @@ -43,76 +83,58 @@ func NewImageShareWithDefaults() *ImageShare { } // GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. -func (o *ImageShare) GetParentOrganization() *bool { - if o == nil || IsNil(o.ParentOrganization) { - var ret *bool - return ret - } - return o.ParentOrganization +func (o *ImageShare) GetParentOrganization() (res ImageSharegetParentOrganizationRetType) { + res, _ = o.GetParentOrganizationOk() + return } // GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ImageShare) GetParentOrganizationOk() (*bool, bool) { - if o == nil || IsNil(o.ParentOrganization) { - return nil, false - } - return o.ParentOrganization, true +func (o *ImageShare) GetParentOrganizationOk() (ret ImageSharegetParentOrganizationRetType, ok bool) { + return getImageSharegetParentOrganizationAttributeTypeOk(o.ParentOrganization) } // HasParentOrganization returns a boolean if a field has been set. func (o *ImageShare) HasParentOrganization() bool { - if o != nil && !IsNil(o.ParentOrganization) { - return true - } - - return false + _, ok := o.GetParentOrganizationOk() + return ok } // SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. -func (o *ImageShare) SetParentOrganization(v *bool) { - o.ParentOrganization = v +func (o *ImageShare) SetParentOrganization(v ImageSharegetParentOrganizationRetType) { + setImageSharegetParentOrganizationAttributeType(&o.ParentOrganization, v) } // GetProjects returns the Projects field value if set, zero value otherwise. -func (o *ImageShare) GetProjects() *[]string { - if o == nil || IsNil(o.Projects) { - var ret *[]string - return ret - } - return o.Projects +func (o *ImageShare) GetProjects() (res ImageShareGetProjectsRetType) { + res, _ = o.GetProjectsOk() + return } // GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ImageShare) GetProjectsOk() (*[]string, bool) { - if o == nil || IsNil(o.Projects) { - return nil, false - } - return o.Projects, true +func (o *ImageShare) GetProjectsOk() (ret ImageShareGetProjectsRetType, ok bool) { + return getImageShareGetProjectsAttributeTypeOk(o.Projects) } // HasProjects returns a boolean if a field has been set. func (o *ImageShare) HasProjects() bool { - if o != nil && !IsNil(o.Projects) { - return true - } - - return false + _, ok := o.GetProjectsOk() + return ok } // SetProjects gets a reference to the given []string and assigns it to the Projects field. -func (o *ImageShare) SetProjects(v *[]string) { - o.Projects = v +func (o *ImageShare) SetProjects(v ImageShareGetProjectsRetType) { + setImageShareGetProjectsAttributeType(&o.Projects, v) } func (o ImageShare) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.ParentOrganization) { - toSerialize["parentOrganization"] = o.ParentOrganization + if val, ok := getImageSharegetParentOrganizationAttributeTypeOk(o.ParentOrganization); ok { + toSerialize["ParentOrganization"] = val } - if !IsNil(o.Projects) { - toSerialize["projects"] = o.Projects + if val, ok := getImageShareGetProjectsAttributeTypeOk(o.Projects); ok { + toSerialize["Projects"] = val } return toSerialize, nil } diff --git a/services/iaas/model_image_share_consumer.go b/services/iaas/model_image_share_consumer.go index 056239588..ae4a0afa0 100644 --- a/services/iaas/model_image_share_consumer.go +++ b/services/iaas/model_image_share_consumer.go @@ -18,16 +18,98 @@ import ( // checks if the ImageShareConsumer type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ImageShareConsumer{} +/* + types and functions for consumerProjectId +*/ + +// isNotNullableString +type ImageShareConsumerGetConsumerProjectIdAttributeType = *string + +func getImageShareConsumerGetConsumerProjectIdAttributeTypeOk(arg ImageShareConsumerGetConsumerProjectIdAttributeType) (ret ImageShareConsumerGetConsumerProjectIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageShareConsumerGetConsumerProjectIdAttributeType(arg *ImageShareConsumerGetConsumerProjectIdAttributeType, val ImageShareConsumerGetConsumerProjectIdRetType) { + *arg = &val +} + +type ImageShareConsumerGetConsumerProjectIdArgType = string +type ImageShareConsumerGetConsumerProjectIdRetType = string + +/* + types and functions for createdAt +*/ + +// isDateTime +type ImageShareConsumerGetCreatedAtAttributeType = *time.Time +type ImageShareConsumerGetCreatedAtArgType = time.Time +type ImageShareConsumerGetCreatedAtRetType = time.Time + +func getImageShareConsumerGetCreatedAtAttributeTypeOk(arg ImageShareConsumerGetCreatedAtAttributeType) (ret ImageShareConsumerGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageShareConsumerGetCreatedAtAttributeType(arg *ImageShareConsumerGetCreatedAtAttributeType, val ImageShareConsumerGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for imageId +*/ + +// isNotNullableString +type ImageShareConsumerGetImageIdAttributeType = *string + +func getImageShareConsumerGetImageIdAttributeTypeOk(arg ImageShareConsumerGetImageIdAttributeType) (ret ImageShareConsumerGetImageIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageShareConsumerGetImageIdAttributeType(arg *ImageShareConsumerGetImageIdAttributeType, val ImageShareConsumerGetImageIdRetType) { + *arg = &val +} + +type ImageShareConsumerGetImageIdArgType = string +type ImageShareConsumerGetImageIdRetType = string + +/* + types and functions for updatedAt +*/ + +// isDateTime +type ImageShareConsumerGetUpdatedAtAttributeType = *time.Time +type ImageShareConsumerGetUpdatedAtArgType = time.Time +type ImageShareConsumerGetUpdatedAtRetType = time.Time + +func getImageShareConsumerGetUpdatedAtAttributeTypeOk(arg ImageShareConsumerGetUpdatedAtAttributeType) (ret ImageShareConsumerGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageShareConsumerGetUpdatedAtAttributeType(arg *ImageShareConsumerGetUpdatedAtAttributeType, val ImageShareConsumerGetUpdatedAtRetType) { + *arg = &val +} + // ImageShareConsumer The details of an Image share consumer. type ImageShareConsumer struct { // Universally Unique Identifier (UUID). - ConsumerProjectId *string `json:"consumerProjectId,omitempty"` + ConsumerProjectId ImageShareConsumerGetConsumerProjectIdAttributeType `json:"consumerProjectId,omitempty"` // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt ImageShareConsumerGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Universally Unique Identifier (UUID). - ImageId *string `json:"imageId,omitempty"` + ImageId ImageShareConsumerGetImageIdAttributeType `json:"imageId,omitempty"` // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAt ImageShareConsumerGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } // NewImageShareConsumer instantiates a new ImageShareConsumer object @@ -48,146 +130,110 @@ func NewImageShareConsumerWithDefaults() *ImageShareConsumer { } // GetConsumerProjectId returns the ConsumerProjectId field value if set, zero value otherwise. -func (o *ImageShareConsumer) GetConsumerProjectId() *string { - if o == nil || IsNil(o.ConsumerProjectId) { - var ret *string - return ret - } - return o.ConsumerProjectId +func (o *ImageShareConsumer) GetConsumerProjectId() (res ImageShareConsumerGetConsumerProjectIdRetType) { + res, _ = o.GetConsumerProjectIdOk() + return } // GetConsumerProjectIdOk returns a tuple with the ConsumerProjectId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ImageShareConsumer) GetConsumerProjectIdOk() (*string, bool) { - if o == nil || IsNil(o.ConsumerProjectId) { - return nil, false - } - return o.ConsumerProjectId, true +func (o *ImageShareConsumer) GetConsumerProjectIdOk() (ret ImageShareConsumerGetConsumerProjectIdRetType, ok bool) { + return getImageShareConsumerGetConsumerProjectIdAttributeTypeOk(o.ConsumerProjectId) } // HasConsumerProjectId returns a boolean if a field has been set. func (o *ImageShareConsumer) HasConsumerProjectId() bool { - if o != nil && !IsNil(o.ConsumerProjectId) { - return true - } - - return false + _, ok := o.GetConsumerProjectIdOk() + return ok } // SetConsumerProjectId gets a reference to the given string and assigns it to the ConsumerProjectId field. -func (o *ImageShareConsumer) SetConsumerProjectId(v *string) { - o.ConsumerProjectId = v +func (o *ImageShareConsumer) SetConsumerProjectId(v ImageShareConsumerGetConsumerProjectIdRetType) { + setImageShareConsumerGetConsumerProjectIdAttributeType(&o.ConsumerProjectId, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *ImageShareConsumer) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - return o.CreatedAt +func (o *ImageShareConsumer) GetCreatedAt() (res ImageShareConsumerGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return } // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ImageShareConsumer) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true +func (o *ImageShareConsumer) GetCreatedAtOk() (ret ImageShareConsumerGetCreatedAtRetType, ok bool) { + return getImageShareConsumerGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. func (o *ImageShareConsumer) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false + _, ok := o.GetCreatedAtOk() + return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *ImageShareConsumer) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *ImageShareConsumer) SetCreatedAt(v ImageShareConsumerGetCreatedAtRetType) { + setImageShareConsumerGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetImageId returns the ImageId field value if set, zero value otherwise. -func (o *ImageShareConsumer) GetImageId() *string { - if o == nil || IsNil(o.ImageId) { - var ret *string - return ret - } - return o.ImageId +func (o *ImageShareConsumer) GetImageId() (res ImageShareConsumerGetImageIdRetType) { + res, _ = o.GetImageIdOk() + return } // GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ImageShareConsumer) GetImageIdOk() (*string, bool) { - if o == nil || IsNil(o.ImageId) { - return nil, false - } - return o.ImageId, true +func (o *ImageShareConsumer) GetImageIdOk() (ret ImageShareConsumerGetImageIdRetType, ok bool) { + return getImageShareConsumerGetImageIdAttributeTypeOk(o.ImageId) } // HasImageId returns a boolean if a field has been set. func (o *ImageShareConsumer) HasImageId() bool { - if o != nil && !IsNil(o.ImageId) { - return true - } - - return false + _, ok := o.GetImageIdOk() + return ok } // SetImageId gets a reference to the given string and assigns it to the ImageId field. -func (o *ImageShareConsumer) SetImageId(v *string) { - o.ImageId = v +func (o *ImageShareConsumer) SetImageId(v ImageShareConsumerGetImageIdRetType) { + setImageShareConsumerGetImageIdAttributeType(&o.ImageId, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *ImageShareConsumer) GetUpdatedAt() *time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret *time.Time - return ret - } - return o.UpdatedAt +func (o *ImageShareConsumer) GetUpdatedAt() (res ImageShareConsumerGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ImageShareConsumer) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true +func (o *ImageShareConsumer) GetUpdatedAtOk() (ret ImageShareConsumerGetUpdatedAtRetType, ok bool) { + return getImageShareConsumerGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. func (o *ImageShareConsumer) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false + _, ok := o.GetUpdatedAtOk() + return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *ImageShareConsumer) SetUpdatedAt(v *time.Time) { - o.UpdatedAt = v +func (o *ImageShareConsumer) SetUpdatedAt(v ImageShareConsumerGetUpdatedAtRetType) { + setImageShareConsumerGetUpdatedAtAttributeType(&o.UpdatedAt, v) } func (o ImageShareConsumer) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.ConsumerProjectId) { - toSerialize["consumerProjectId"] = o.ConsumerProjectId + if val, ok := getImageShareConsumerGetConsumerProjectIdAttributeTypeOk(o.ConsumerProjectId); ok { + toSerialize["ConsumerProjectId"] = val } - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt + if val, ok := getImageShareConsumerGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val } - if !IsNil(o.ImageId) { - toSerialize["imageId"] = o.ImageId + if val, ok := getImageShareConsumerGetImageIdAttributeTypeOk(o.ImageId); ok { + toSerialize["ImageId"] = val } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt + if val, ok := getImageShareConsumerGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val } return toSerialize, nil } diff --git a/services/iaas/model_key_pair_list_response.go b/services/iaas/model_key_pair_list_response.go index 07c903483..86f63c405 100644 --- a/services/iaas/model_key_pair_list_response.go +++ b/services/iaas/model_key_pair_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the KeyPairListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &KeyPairListResponse{} +/* + types and functions for items +*/ + +// isArray +type KeyPairListResponseGetItemsAttributeType = *[]Keypair +type KeyPairListResponseGetItemsArgType = []Keypair +type KeyPairListResponseGetItemsRetType = []Keypair + +func getKeyPairListResponseGetItemsAttributeTypeOk(arg KeyPairListResponseGetItemsAttributeType) (ret KeyPairListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setKeyPairListResponseGetItemsAttributeType(arg *KeyPairListResponseGetItemsAttributeType, val KeyPairListResponseGetItemsRetType) { + *arg = &val +} + // KeyPairListResponse SSH keypair list response. type KeyPairListResponse struct { // A list of SSH keypairs. // REQUIRED - Items *[]Keypair `json:"items"` + Items KeyPairListResponseGetItemsAttributeType `json:"items"` } type _KeyPairListResponse KeyPairListResponse @@ -30,9 +50,9 @@ type _KeyPairListResponse KeyPairListResponse // 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 NewKeyPairListResponse(items *[]Keypair) *KeyPairListResponse { +func NewKeyPairListResponse(items KeyPairListResponseGetItemsArgType) *KeyPairListResponse { this := KeyPairListResponse{} - this.Items = items + setKeyPairListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewKeyPairListResponseWithDefaults() *KeyPairListResponse { } // GetItems returns the Items field value -func (o *KeyPairListResponse) GetItems() *[]Keypair { - if o == nil || IsNil(o.Items) { - var ret *[]Keypair - return ret - } - - return o.Items +func (o *KeyPairListResponse) GetItems() (ret KeyPairListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *KeyPairListResponse) GetItemsOk() (*[]Keypair, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *KeyPairListResponse) GetItemsOk() (ret KeyPairListResponseGetItemsRetType, ok bool) { + return getKeyPairListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *KeyPairListResponse) SetItems(v *[]Keypair) { - o.Items = v +func (o *KeyPairListResponse) SetItems(v KeyPairListResponseGetItemsRetType) { + setKeyPairListResponseGetItemsAttributeType(&o.Items, v) } func (o KeyPairListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getKeyPairListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_keypair.go b/services/iaas/model_keypair.go index 4deffa6d7..69eeec2cb 100644 --- a/services/iaas/model_keypair.go +++ b/services/iaas/model_keypair.go @@ -18,21 +18,144 @@ import ( // checks if the Keypair type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Keypair{} +/* + types and functions for createdAt +*/ + +// isDateTime +type KeypairGetCreatedAtAttributeType = *time.Time +type KeypairGetCreatedAtArgType = time.Time +type KeypairGetCreatedAtRetType = time.Time + +func getKeypairGetCreatedAtAttributeTypeOk(arg KeypairGetCreatedAtAttributeType) (ret KeypairGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setKeypairGetCreatedAtAttributeType(arg *KeypairGetCreatedAtAttributeType, val KeypairGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for fingerprint +*/ + +// isNotNullableString +type KeypairGetFingerprintAttributeType = *string + +func getKeypairGetFingerprintAttributeTypeOk(arg KeypairGetFingerprintAttributeType) (ret KeypairGetFingerprintRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setKeypairGetFingerprintAttributeType(arg *KeypairGetFingerprintAttributeType, val KeypairGetFingerprintRetType) { + *arg = &val +} + +type KeypairGetFingerprintArgType = string +type KeypairGetFingerprintRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type KeypairGetLabelsAttributeType = *map[string]interface{} +type KeypairGetLabelsArgType = map[string]interface{} +type KeypairGetLabelsRetType = map[string]interface{} + +func getKeypairGetLabelsAttributeTypeOk(arg KeypairGetLabelsAttributeType) (ret KeypairGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setKeypairGetLabelsAttributeType(arg *KeypairGetLabelsAttributeType, val KeypairGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type KeypairGetNameAttributeType = *string + +func getKeypairGetNameAttributeTypeOk(arg KeypairGetNameAttributeType) (ret KeypairGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setKeypairGetNameAttributeType(arg *KeypairGetNameAttributeType, val KeypairGetNameRetType) { + *arg = &val +} + +type KeypairGetNameArgType = string +type KeypairGetNameRetType = string + +/* + types and functions for publicKey +*/ + +// isNotNullableString +type KeypairGetPublicKeyAttributeType = *string + +func getKeypairGetPublicKeyAttributeTypeOk(arg KeypairGetPublicKeyAttributeType) (ret KeypairGetPublicKeyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setKeypairGetPublicKeyAttributeType(arg *KeypairGetPublicKeyAttributeType, val KeypairGetPublicKeyRetType) { + *arg = &val +} + +type KeypairGetPublicKeyArgType = string +type KeypairGetPublicKeyRetType = string + +/* + types and functions for updatedAt +*/ + +// isDateTime +type KeypairGetUpdatedAtAttributeType = *time.Time +type KeypairGetUpdatedAtArgType = time.Time +type KeypairGetUpdatedAtRetType = time.Time + +func getKeypairGetUpdatedAtAttributeTypeOk(arg KeypairGetUpdatedAtAttributeType) (ret KeypairGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setKeypairGetUpdatedAtAttributeType(arg *KeypairGetUpdatedAtAttributeType, val KeypairGetUpdatedAtRetType) { + *arg = &val +} + // Keypair Object that represents the public key of an SSH keypair and its name. type Keypair struct { // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt KeypairGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Object that represents an SSH keypair MD5 fingerprint. - Fingerprint *string `json:"fingerprint,omitempty"` + Fingerprint KeypairGetFingerprintAttributeType `json:"fingerprint,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels KeypairGetLabelsAttributeType `json:"labels,omitempty"` // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. - Name *string `json:"name,omitempty"` + Name KeypairGetNameAttributeType `json:"name,omitempty"` // Object that represents a public SSH key. // REQUIRED - PublicKey *string `json:"publicKey"` + PublicKey KeypairGetPublicKeyAttributeType `json:"publicKey"` // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAt KeypairGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } type _Keypair Keypair @@ -41,9 +164,9 @@ type _Keypair Keypair // 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 NewKeypair(publicKey *string) *Keypair { +func NewKeypair(publicKey KeypairGetPublicKeyArgType) *Keypair { this := Keypair{} - this.PublicKey = publicKey + setKeypairGetPublicKeyAttributeType(&this.PublicKey, publicKey) return &this } @@ -56,206 +179,156 @@ func NewKeypairWithDefaults() *Keypair { } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *Keypair) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - return o.CreatedAt +func (o *Keypair) GetCreatedAt() (res KeypairGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return } // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Keypair) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true +func (o *Keypair) GetCreatedAtOk() (ret KeypairGetCreatedAtRetType, ok bool) { + return getKeypairGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. func (o *Keypair) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false + _, ok := o.GetCreatedAtOk() + return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *Keypair) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *Keypair) SetCreatedAt(v KeypairGetCreatedAtRetType) { + setKeypairGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetFingerprint returns the Fingerprint field value if set, zero value otherwise. -func (o *Keypair) GetFingerprint() *string { - if o == nil || IsNil(o.Fingerprint) { - var ret *string - return ret - } - return o.Fingerprint +func (o *Keypair) GetFingerprint() (res KeypairGetFingerprintRetType) { + res, _ = o.GetFingerprintOk() + return } // GetFingerprintOk returns a tuple with the Fingerprint field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Keypair) GetFingerprintOk() (*string, bool) { - if o == nil || IsNil(o.Fingerprint) { - return nil, false - } - return o.Fingerprint, true +func (o *Keypair) GetFingerprintOk() (ret KeypairGetFingerprintRetType, ok bool) { + return getKeypairGetFingerprintAttributeTypeOk(o.Fingerprint) } // HasFingerprint returns a boolean if a field has been set. func (o *Keypair) HasFingerprint() bool { - if o != nil && !IsNil(o.Fingerprint) { - return true - } - - return false + _, ok := o.GetFingerprintOk() + return ok } // SetFingerprint gets a reference to the given string and assigns it to the Fingerprint field. -func (o *Keypair) SetFingerprint(v *string) { - o.Fingerprint = v +func (o *Keypair) SetFingerprint(v KeypairGetFingerprintRetType) { + setKeypairGetFingerprintAttributeType(&o.Fingerprint, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *Keypair) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *Keypair) GetLabels() (res KeypairGetLabelsRetType) { + 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 *Keypair) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *Keypair) GetLabelsOk() (ret KeypairGetLabelsRetType, ok bool) { + return getKeypairGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *Keypair) 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 *Keypair) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *Keypair) SetLabels(v KeypairGetLabelsRetType) { + setKeypairGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *Keypair) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *Keypair) GetName() (res KeypairGetNameRetType) { + 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 *Keypair) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *Keypair) GetNameOk() (ret KeypairGetNameRetType, ok bool) { + return getKeypairGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *Keypair) 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 *Keypair) SetName(v *string) { - o.Name = v +func (o *Keypair) SetName(v KeypairGetNameRetType) { + setKeypairGetNameAttributeType(&o.Name, v) } // GetPublicKey returns the PublicKey field value -func (o *Keypair) GetPublicKey() *string { - if o == nil || IsNil(o.PublicKey) { - var ret *string - return ret - } - - return o.PublicKey +func (o *Keypair) GetPublicKey() (ret KeypairGetPublicKeyRetType) { + ret, _ = o.GetPublicKeyOk() + return ret } // GetPublicKeyOk returns a tuple with the PublicKey field value // and a boolean to check if the value has been set. -func (o *Keypair) GetPublicKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.PublicKey, true +func (o *Keypair) GetPublicKeyOk() (ret KeypairGetPublicKeyRetType, ok bool) { + return getKeypairGetPublicKeyAttributeTypeOk(o.PublicKey) } // SetPublicKey sets field value -func (o *Keypair) SetPublicKey(v *string) { - o.PublicKey = v +func (o *Keypair) SetPublicKey(v KeypairGetPublicKeyRetType) { + setKeypairGetPublicKeyAttributeType(&o.PublicKey, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *Keypair) GetUpdatedAt() *time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret *time.Time - return ret - } - return o.UpdatedAt +func (o *Keypair) GetUpdatedAt() (res KeypairGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Keypair) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true +func (o *Keypair) GetUpdatedAtOk() (ret KeypairGetUpdatedAtRetType, ok bool) { + return getKeypairGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. func (o *Keypair) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false + _, ok := o.GetUpdatedAtOk() + return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *Keypair) SetUpdatedAt(v *time.Time) { - o.UpdatedAt = v +func (o *Keypair) SetUpdatedAt(v KeypairGetUpdatedAtRetType) { + setKeypairGetUpdatedAtAttributeType(&o.UpdatedAt, v) } func (o Keypair) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt + if val, ok := getKeypairGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getKeypairGetFingerprintAttributeTypeOk(o.Fingerprint); ok { + toSerialize["Fingerprint"] = val } - if !IsNil(o.Fingerprint) { - toSerialize["fingerprint"] = o.Fingerprint + if val, ok := getKeypairGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getKeypairGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getKeypairGetPublicKeyAttributeTypeOk(o.PublicKey); ok { + toSerialize["PublicKey"] = val } - toSerialize["publicKey"] = o.PublicKey - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt + if val, ok := getKeypairGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val } return toSerialize, nil } diff --git a/services/iaas/model_machine_type.go b/services/iaas/model_machine_type.go index 5bae7994a..fd11a832b 100644 --- a/services/iaas/model_machine_type.go +++ b/services/iaas/model_machine_type.go @@ -17,24 +17,146 @@ import ( // checks if the MachineType type satisfies the MappedNullable interface at compile time var _ MappedNullable = &MachineType{} +/* + types and functions for description +*/ + +// isNotNullableString +type MachineTypeGetDescriptionAttributeType = *string + +func getMachineTypeGetDescriptionAttributeTypeOk(arg MachineTypeGetDescriptionAttributeType) (ret MachineTypeGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMachineTypeGetDescriptionAttributeType(arg *MachineTypeGetDescriptionAttributeType, val MachineTypeGetDescriptionRetType) { + *arg = &val +} + +type MachineTypeGetDescriptionArgType = string +type MachineTypeGetDescriptionRetType = string + +/* + types and functions for disk +*/ + +// isLong +type MachineTypeGetDiskAttributeType = *int64 +type MachineTypeGetDiskArgType = int64 +type MachineTypeGetDiskRetType = int64 + +func getMachineTypeGetDiskAttributeTypeOk(arg MachineTypeGetDiskAttributeType) (ret MachineTypeGetDiskRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMachineTypeGetDiskAttributeType(arg *MachineTypeGetDiskAttributeType, val MachineTypeGetDiskRetType) { + *arg = &val +} + +/* + types and functions for extraSpecs +*/ + +// isFreeform +type MachineTypeGetExtraSpecsAttributeType = *map[string]interface{} +type MachineTypeGetExtraSpecsArgType = map[string]interface{} +type MachineTypeGetExtraSpecsRetType = map[string]interface{} + +func getMachineTypeGetExtraSpecsAttributeTypeOk(arg MachineTypeGetExtraSpecsAttributeType) (ret MachineTypeGetExtraSpecsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMachineTypeGetExtraSpecsAttributeType(arg *MachineTypeGetExtraSpecsAttributeType, val MachineTypeGetExtraSpecsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type MachineTypeGetNameAttributeType = *string + +func getMachineTypeGetNameAttributeTypeOk(arg MachineTypeGetNameAttributeType) (ret MachineTypeGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMachineTypeGetNameAttributeType(arg *MachineTypeGetNameAttributeType, val MachineTypeGetNameRetType) { + *arg = &val +} + +type MachineTypeGetNameArgType = string +type MachineTypeGetNameRetType = string + +/* + types and functions for ram +*/ + +// isLong +type MachineTypeGetRamAttributeType = *int64 +type MachineTypeGetRamArgType = int64 +type MachineTypeGetRamRetType = int64 + +func getMachineTypeGetRamAttributeTypeOk(arg MachineTypeGetRamAttributeType) (ret MachineTypeGetRamRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMachineTypeGetRamAttributeType(arg *MachineTypeGetRamAttributeType, val MachineTypeGetRamRetType) { + *arg = &val +} + +/* + types and functions for vcpus +*/ + +// isLong +type MachineTypeGetVcpusAttributeType = *int64 +type MachineTypeGetVcpusArgType = int64 +type MachineTypeGetVcpusRetType = int64 + +func getMachineTypeGetVcpusAttributeTypeOk(arg MachineTypeGetVcpusAttributeType) (ret MachineTypeGetVcpusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMachineTypeGetVcpusAttributeType(arg *MachineTypeGetVcpusAttributeType, val MachineTypeGetVcpusRetType) { + *arg = &val +} + // MachineType Machine Type. type MachineType struct { // Description Object. Allows string up to 127 Characters. - Description *string `json:"description,omitempty"` + Description MachineTypeGetDescriptionAttributeType `json:"description,omitempty"` // Size in Gigabyte. // REQUIRED - Disk *int64 `json:"disk"` + Disk MachineTypeGetDiskAttributeType `json:"disk"` // Properties to control certain aspects or scheduling behavior for an object. - ExtraSpecs *map[string]interface{} `json:"extraSpecs,omitempty"` + ExtraSpecs MachineTypeGetExtraSpecsAttributeType `json:"extraSpecs,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED - Name *string `json:"name"` + Name MachineTypeGetNameAttributeType `json:"name"` // Size in Megabyte. // REQUIRED - Ram *int64 `json:"ram"` + Ram MachineTypeGetRamAttributeType `json:"ram"` // The number of virtual CPUs of a server. // REQUIRED - Vcpus *int64 `json:"vcpus"` + Vcpus MachineTypeGetVcpusAttributeType `json:"vcpus"` } type _MachineType MachineType @@ -43,12 +165,12 @@ type _MachineType MachineType // 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 NewMachineType(disk *int64, name *string, ram *int64, vcpus *int64) *MachineType { +func NewMachineType(disk MachineTypeGetDiskArgType, name MachineTypeGetNameArgType, ram MachineTypeGetRamArgType, vcpus MachineTypeGetVcpusArgType) *MachineType { this := MachineType{} - this.Disk = disk - this.Name = name - this.Ram = ram - this.Vcpus = vcpus + setMachineTypeGetDiskAttributeType(&this.Disk, disk) + setMachineTypeGetNameAttributeType(&this.Name, name) + setMachineTypeGetRamAttributeType(&this.Ram, ram) + setMachineTypeGetVcpusAttributeType(&this.Vcpus, vcpus) return &this } @@ -61,177 +183,139 @@ func NewMachineTypeWithDefaults() *MachineType { } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *MachineType) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *MachineType) GetDescription() (res MachineTypeGetDescriptionRetType) { + 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 *MachineType) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *MachineType) GetDescriptionOk() (ret MachineTypeGetDescriptionRetType, ok bool) { + return getMachineTypeGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *MachineType) 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 *MachineType) SetDescription(v *string) { - o.Description = v +func (o *MachineType) SetDescription(v MachineTypeGetDescriptionRetType) { + setMachineTypeGetDescriptionAttributeType(&o.Description, v) } // GetDisk returns the Disk field value -func (o *MachineType) GetDisk() *int64 { - if o == nil || IsNil(o.Disk) { - var ret *int64 - return ret - } - - return o.Disk +func (o *MachineType) GetDisk() (ret MachineTypeGetDiskRetType) { + ret, _ = o.GetDiskOk() + return ret } // GetDiskOk returns a tuple with the Disk field value // and a boolean to check if the value has been set. -func (o *MachineType) GetDiskOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Disk, true +func (o *MachineType) GetDiskOk() (ret MachineTypeGetDiskRetType, ok bool) { + return getMachineTypeGetDiskAttributeTypeOk(o.Disk) } // SetDisk sets field value -func (o *MachineType) SetDisk(v *int64) { - o.Disk = v +func (o *MachineType) SetDisk(v MachineTypeGetDiskRetType) { + setMachineTypeGetDiskAttributeType(&o.Disk, v) } // GetExtraSpecs returns the ExtraSpecs field value if set, zero value otherwise. -func (o *MachineType) GetExtraSpecs() *map[string]interface{} { - if o == nil || IsNil(o.ExtraSpecs) { - var ret *map[string]interface{} - return ret - } - return o.ExtraSpecs +func (o *MachineType) GetExtraSpecs() (res MachineTypeGetExtraSpecsRetType) { + res, _ = o.GetExtraSpecsOk() + return } // GetExtraSpecsOk returns a tuple with the ExtraSpecs field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MachineType) GetExtraSpecsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.ExtraSpecs) { - return &map[string]interface{}{}, false - } - return o.ExtraSpecs, true +func (o *MachineType) GetExtraSpecsOk() (ret MachineTypeGetExtraSpecsRetType, ok bool) { + return getMachineTypeGetExtraSpecsAttributeTypeOk(o.ExtraSpecs) } // HasExtraSpecs returns a boolean if a field has been set. func (o *MachineType) HasExtraSpecs() bool { - if o != nil && !IsNil(o.ExtraSpecs) { - return true - } - - return false + _, ok := o.GetExtraSpecsOk() + return ok } // SetExtraSpecs gets a reference to the given map[string]interface{} and assigns it to the ExtraSpecs field. -func (o *MachineType) SetExtraSpecs(v *map[string]interface{}) { - o.ExtraSpecs = v +func (o *MachineType) SetExtraSpecs(v MachineTypeGetExtraSpecsRetType) { + setMachineTypeGetExtraSpecsAttributeType(&o.ExtraSpecs, v) } // GetName returns the Name field value -func (o *MachineType) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *MachineType) GetName() (ret MachineTypeGetNameRetType) { + 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 *MachineType) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *MachineType) GetNameOk() (ret MachineTypeGetNameRetType, ok bool) { + return getMachineTypeGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *MachineType) SetName(v *string) { - o.Name = v +func (o *MachineType) SetName(v MachineTypeGetNameRetType) { + setMachineTypeGetNameAttributeType(&o.Name, v) } // GetRam returns the Ram field value -func (o *MachineType) GetRam() *int64 { - if o == nil || IsNil(o.Ram) { - var ret *int64 - return ret - } - - return o.Ram +func (o *MachineType) GetRam() (ret MachineTypeGetRamRetType) { + ret, _ = o.GetRamOk() + return ret } // GetRamOk returns a tuple with the Ram field value // and a boolean to check if the value has been set. -func (o *MachineType) GetRamOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Ram, true +func (o *MachineType) GetRamOk() (ret MachineTypeGetRamRetType, ok bool) { + return getMachineTypeGetRamAttributeTypeOk(o.Ram) } // SetRam sets field value -func (o *MachineType) SetRam(v *int64) { - o.Ram = v +func (o *MachineType) SetRam(v MachineTypeGetRamRetType) { + setMachineTypeGetRamAttributeType(&o.Ram, v) } // GetVcpus returns the Vcpus field value -func (o *MachineType) GetVcpus() *int64 { - if o == nil || IsNil(o.Vcpus) { - var ret *int64 - return ret - } - - return o.Vcpus +func (o *MachineType) GetVcpus() (ret MachineTypeGetVcpusRetType) { + ret, _ = o.GetVcpusOk() + return ret } // GetVcpusOk returns a tuple with the Vcpus field value // and a boolean to check if the value has been set. -func (o *MachineType) GetVcpusOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Vcpus, true +func (o *MachineType) GetVcpusOk() (ret MachineTypeGetVcpusRetType, ok bool) { + return getMachineTypeGetVcpusAttributeTypeOk(o.Vcpus) } // SetVcpus sets field value -func (o *MachineType) SetVcpus(v *int64) { - o.Vcpus = v +func (o *MachineType) SetVcpus(v MachineTypeGetVcpusRetType) { + setMachineTypeGetVcpusAttributeType(&o.Vcpus, v) } func (o MachineType) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getMachineTypeGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getMachineTypeGetDiskAttributeTypeOk(o.Disk); ok { + toSerialize["Disk"] = val + } + if val, ok := getMachineTypeGetExtraSpecsAttributeTypeOk(o.ExtraSpecs); ok { + toSerialize["ExtraSpecs"] = val + } + if val, ok := getMachineTypeGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getMachineTypeGetRamAttributeTypeOk(o.Ram); ok { + toSerialize["Ram"] = val } - toSerialize["disk"] = o.Disk - if !IsNil(o.ExtraSpecs) { - toSerialize["extraSpecs"] = o.ExtraSpecs + if val, ok := getMachineTypeGetVcpusAttributeTypeOk(o.Vcpus); ok { + toSerialize["Vcpus"] = val } - toSerialize["name"] = o.Name - toSerialize["ram"] = o.Ram - toSerialize["vcpus"] = o.Vcpus return toSerialize, nil } diff --git a/services/iaas/model_machine_type_list_response.go b/services/iaas/model_machine_type_list_response.go index 4fda880d5..162a09635 100644 --- a/services/iaas/model_machine_type_list_response.go +++ b/services/iaas/model_machine_type_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the MachineTypeListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &MachineTypeListResponse{} +/* + types and functions for items +*/ + +// isArray +type MachineTypeListResponseGetItemsAttributeType = *[]MachineType +type MachineTypeListResponseGetItemsArgType = []MachineType +type MachineTypeListResponseGetItemsRetType = []MachineType + +func getMachineTypeListResponseGetItemsAttributeTypeOk(arg MachineTypeListResponseGetItemsAttributeType) (ret MachineTypeListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMachineTypeListResponseGetItemsAttributeType(arg *MachineTypeListResponseGetItemsAttributeType, val MachineTypeListResponseGetItemsRetType) { + *arg = &val +} + // MachineTypeListResponse Machine type list response. type MachineTypeListResponse struct { // Machine type list. // REQUIRED - Items *[]MachineType `json:"items"` + Items MachineTypeListResponseGetItemsAttributeType `json:"items"` } type _MachineTypeListResponse MachineTypeListResponse @@ -30,9 +50,9 @@ type _MachineTypeListResponse MachineTypeListResponse // 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 NewMachineTypeListResponse(items *[]MachineType) *MachineTypeListResponse { +func NewMachineTypeListResponse(items MachineTypeListResponseGetItemsArgType) *MachineTypeListResponse { this := MachineTypeListResponse{} - this.Items = items + setMachineTypeListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewMachineTypeListResponseWithDefaults() *MachineTypeListResponse { } // GetItems returns the Items field value -func (o *MachineTypeListResponse) GetItems() *[]MachineType { - if o == nil || IsNil(o.Items) { - var ret *[]MachineType - return ret - } - - return o.Items +func (o *MachineTypeListResponse) GetItems() (ret MachineTypeListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *MachineTypeListResponse) GetItemsOk() (*[]MachineType, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *MachineTypeListResponse) GetItemsOk() (ret MachineTypeListResponseGetItemsRetType, ok bool) { + return getMachineTypeListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *MachineTypeListResponse) SetItems(v *[]MachineType) { - o.Items = v +func (o *MachineTypeListResponse) SetItems(v MachineTypeListResponseGetItemsRetType) { + setMachineTypeListResponseGetItemsAttributeType(&o.Items, v) } func (o MachineTypeListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getMachineTypeListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_network.go b/services/iaas/model_network.go index e14f60faf..cbd710359 100644 --- a/services/iaas/model_network.go +++ b/services/iaas/model_network.go @@ -18,36 +18,330 @@ import ( // checks if the Network type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Network{} +/* + types and functions for createdAt +*/ + +// isDateTime +type NetworkGetCreatedAtAttributeType = *time.Time +type NetworkGetCreatedAtArgType = time.Time +type NetworkGetCreatedAtRetType = time.Time + +func getNetworkGetCreatedAtAttributeTypeOk(arg NetworkGetCreatedAtAttributeType) (ret NetworkGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkGetCreatedAtAttributeType(arg *NetworkGetCreatedAtAttributeType, val NetworkGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for gateway +*/ + +// isNullableString +type NetworkGetGatewayAttributeType = *NullableString + +func getNetworkGetGatewayAttributeTypeOk(arg NetworkGetGatewayAttributeType) (ret NetworkGetGatewayRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setNetworkGetGatewayAttributeType(arg *NetworkGetGatewayAttributeType, val NetworkGetGatewayRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type NetworkGetGatewayArgType = *string +type NetworkGetGatewayRetType = *string + +/* + types and functions for gatewayv6 +*/ + +// isNullableString +type NetworkGetGatewayv6AttributeType = *NullableString + +func getNetworkGetGatewayv6AttributeTypeOk(arg NetworkGetGatewayv6AttributeType) (ret NetworkGetGatewayv6RetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setNetworkGetGatewayv6AttributeType(arg *NetworkGetGatewayv6AttributeType, val NetworkGetGatewayv6RetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type NetworkGetGatewayv6ArgType = *string +type NetworkGetGatewayv6RetType = *string + +/* + types and functions for labels +*/ + +// isFreeform +type NetworkGetLabelsAttributeType = *map[string]interface{} +type NetworkGetLabelsArgType = map[string]interface{} +type NetworkGetLabelsRetType = map[string]interface{} + +func getNetworkGetLabelsAttributeTypeOk(arg NetworkGetLabelsAttributeType) (ret NetworkGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkGetLabelsAttributeType(arg *NetworkGetLabelsAttributeType, val NetworkGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type NetworkGetNameAttributeType = *string + +func getNetworkGetNameAttributeTypeOk(arg NetworkGetNameAttributeType) (ret NetworkGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkGetNameAttributeType(arg *NetworkGetNameAttributeType, val NetworkGetNameRetType) { + *arg = &val +} + +type NetworkGetNameArgType = string +type NetworkGetNameRetType = string + +/* + types and functions for nameservers +*/ + +// isArray +type NetworkGetNameserversAttributeType = *[]string +type NetworkGetNameserversArgType = []string +type NetworkGetNameserversRetType = []string + +func getNetworkGetNameserversAttributeTypeOk(arg NetworkGetNameserversAttributeType) (ret NetworkGetNameserversRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkGetNameserversAttributeType(arg *NetworkGetNameserversAttributeType, val NetworkGetNameserversRetType) { + *arg = &val +} + +/* + types and functions for nameserversV6 +*/ + +// isArray +type NetworkGetNameserversV6AttributeType = *[]string +type NetworkGetNameserversV6ArgType = []string +type NetworkGetNameserversV6RetType = []string + +func getNetworkGetNameserversV6AttributeTypeOk(arg NetworkGetNameserversV6AttributeType) (ret NetworkGetNameserversV6RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkGetNameserversV6AttributeType(arg *NetworkGetNameserversV6AttributeType, val NetworkGetNameserversV6RetType) { + *arg = &val +} + +/* + types and functions for networkId +*/ + +// isNotNullableString +type NetworkGetNetworkIdAttributeType = *string + +func getNetworkGetNetworkIdAttributeTypeOk(arg NetworkGetNetworkIdAttributeType) (ret NetworkGetNetworkIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkGetNetworkIdAttributeType(arg *NetworkGetNetworkIdAttributeType, val NetworkGetNetworkIdRetType) { + *arg = &val +} + +type NetworkGetNetworkIdArgType = string +type NetworkGetNetworkIdRetType = string + +/* + types and functions for prefixes +*/ + +// isArray +type NetworkGetPrefixesAttributeType = *[]string +type NetworkGetPrefixesArgType = []string +type NetworkGetPrefixesRetType = []string + +func getNetworkGetPrefixesAttributeTypeOk(arg NetworkGetPrefixesAttributeType) (ret NetworkGetPrefixesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkGetPrefixesAttributeType(arg *NetworkGetPrefixesAttributeType, val NetworkGetPrefixesRetType) { + *arg = &val +} + +/* + types and functions for prefixesV6 +*/ + +// isArray +type NetworkGetPrefixesV6AttributeType = *[]string +type NetworkGetPrefixesV6ArgType = []string +type NetworkGetPrefixesV6RetType = []string + +func getNetworkGetPrefixesV6AttributeTypeOk(arg NetworkGetPrefixesV6AttributeType) (ret NetworkGetPrefixesV6RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkGetPrefixesV6AttributeType(arg *NetworkGetPrefixesV6AttributeType, val NetworkGetPrefixesV6RetType) { + *arg = &val +} + +/* + types and functions for publicIp +*/ + +// isNotNullableString +type NetworkGetPublicIpAttributeType = *string + +func getNetworkGetPublicIpAttributeTypeOk(arg NetworkGetPublicIpAttributeType) (ret NetworkGetPublicIpRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkGetPublicIpAttributeType(arg *NetworkGetPublicIpAttributeType, val NetworkGetPublicIpRetType) { + *arg = &val +} + +type NetworkGetPublicIpArgType = string +type NetworkGetPublicIpRetType = string + +/* + types and functions for routed +*/ + +// isBoolean +type NetworkgetRoutedAttributeType = *bool +type NetworkgetRoutedArgType = bool +type NetworkgetRoutedRetType = bool + +func getNetworkgetRoutedAttributeTypeOk(arg NetworkgetRoutedAttributeType) (ret NetworkgetRoutedRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkgetRoutedAttributeType(arg *NetworkgetRoutedAttributeType, val NetworkgetRoutedRetType) { + *arg = &val +} + +/* + types and functions for state +*/ + +// isNotNullableString +type NetworkGetStateAttributeType = *string + +func getNetworkGetStateAttributeTypeOk(arg NetworkGetStateAttributeType) (ret NetworkGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkGetStateAttributeType(arg *NetworkGetStateAttributeType, val NetworkGetStateRetType) { + *arg = &val +} + +type NetworkGetStateArgType = string +type NetworkGetStateRetType = string + +/* + types and functions for updatedAt +*/ + +// isDateTime +type NetworkGetUpdatedAtAttributeType = *time.Time +type NetworkGetUpdatedAtArgType = time.Time +type NetworkGetUpdatedAtRetType = time.Time + +func getNetworkGetUpdatedAtAttributeTypeOk(arg NetworkGetUpdatedAtAttributeType) (ret NetworkGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkGetUpdatedAtAttributeType(arg *NetworkGetUpdatedAtAttributeType, val NetworkGetUpdatedAtRetType) { + *arg = &val +} + // Network Object that represents a network. type Network struct { // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt NetworkGetCreatedAtAttributeType `json:"createdAt,omitempty"` // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. - Gateway *NullableString `json:"gateway,omitempty"` + Gateway NetworkGetGatewayAttributeType `json:"gateway,omitempty"` // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. - Gatewayv6 *NullableString `json:"gatewayv6,omitempty"` + Gatewayv6 NetworkGetGatewayv6AttributeType `json:"gatewayv6,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels NetworkGetLabelsAttributeType `json:"labels,omitempty"` // REQUIRED - Name *string `json:"name"` + Name NetworkGetNameAttributeType `json:"name"` // A list containing DNS Servers/Nameservers for IPv4. - Nameservers *[]string `json:"nameservers,omitempty"` + Nameservers NetworkGetNameserversAttributeType `json:"nameservers,omitempty"` // A list containing DNS Servers/Nameservers for IPv6. - NameserversV6 *[]string `json:"nameserversV6,omitempty"` + NameserversV6 NetworkGetNameserversV6AttributeType `json:"nameserversV6,omitempty"` // Universally Unique Identifier (UUID). // REQUIRED - NetworkId *string `json:"networkId"` - Prefixes *[]string `json:"prefixes,omitempty"` - PrefixesV6 *[]string `json:"prefixesV6,omitempty"` + NetworkId NetworkGetNetworkIdAttributeType `json:"networkId"` + Prefixes NetworkGetPrefixesAttributeType `json:"prefixes,omitempty"` + PrefixesV6 NetworkGetPrefixesV6AttributeType `json:"prefixesV6,omitempty"` // Object that represents an IP address. - PublicIp *string `json:"publicIp,omitempty"` + PublicIp NetworkGetPublicIpAttributeType `json:"publicIp,omitempty"` // Shows if the network is routed and therefore accessible from other networks. - Routed *bool `json:"routed,omitempty"` + Routed NetworkgetRoutedAttributeType `json:"routed,omitempty"` // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. // REQUIRED - State *string `json:"state"` + State NetworkGetStateAttributeType `json:"state"` // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAt NetworkGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } type _Network Network @@ -56,11 +350,11 @@ type _Network Network // 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 NewNetwork(name *string, networkId *string, state *string) *Network { +func NewNetwork(name NetworkGetNameArgType, networkId NetworkGetNetworkIdArgType, state NetworkGetStateArgType) *Network { this := Network{} - this.Name = name - this.NetworkId = networkId - this.State = state + setNetworkGetNameAttributeType(&this.Name, name) + setNetworkGetNetworkIdAttributeType(&this.NetworkId, networkId) + setNetworkGetStateAttributeType(&this.State, state) return &this } @@ -73,506 +367,374 @@ func NewNetworkWithDefaults() *Network { } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *Network) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - return o.CreatedAt +func (o *Network) GetCreatedAt() (res NetworkGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return } // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Network) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true +func (o *Network) GetCreatedAtOk() (ret NetworkGetCreatedAtRetType, ok bool) { + return getNetworkGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. func (o *Network) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false + _, ok := o.GetCreatedAtOk() + return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *Network) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *Network) SetCreatedAt(v NetworkGetCreatedAtRetType) { + setNetworkGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Network) GetGateway() *string { - if o == nil || IsNil(o.Gateway) || IsNil(o.Gateway.Get()) { - var ret *string - return ret - } - return o.Gateway.Get() +func (o *Network) GetGateway() (res NetworkGetGatewayRetType) { + res, _ = o.GetGatewayOk() + return } // GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Network) GetGatewayOk() (*string, bool) { - if o == nil || IsNil(o.Gateway) { - return nil, false - } - return o.Gateway.Get(), o.Gateway.IsSet() +func (o *Network) GetGatewayOk() (ret NetworkGetGatewayRetType, ok bool) { + return getNetworkGetGatewayAttributeTypeOk(o.Gateway) } // HasGateway returns a boolean if a field has been set. func (o *Network) HasGateway() bool { - if o != nil && !IsNil(o.Gateway) && o.Gateway.IsSet() { - return true - } - - return false + _, ok := o.GetGatewayOk() + return ok } // SetGateway gets a reference to the given string and assigns it to the Gateway field. -func (o *Network) SetGateway(v *string) { - if IsNil(o.Gateway) { - o.Gateway = new(NullableString) - } - o.Gateway.Set(v) +func (o *Network) SetGateway(v NetworkGetGatewayRetType) { + setNetworkGetGatewayAttributeType(&o.Gateway, v) } // SetGatewayNil sets the value for Gateway to be an explicit nil func (o *Network) SetGatewayNil() { - if IsNil(o.Gateway) { - o.Gateway = new(NullableString) - } - o.Gateway.Set(nil) + o.Gateway = nil } // UnsetGateway ensures that no value is present for Gateway, not even an explicit nil func (o *Network) UnsetGateway() { - if IsNil(o.Gateway) { - o.Gateway = new(NullableString) - } - o.Gateway.Unset() + o.Gateway = nil } // GetGatewayv6 returns the Gatewayv6 field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Network) GetGatewayv6() *string { - if o == nil || IsNil(o.Gatewayv6) || IsNil(o.Gatewayv6.Get()) { - var ret *string - return ret - } - return o.Gatewayv6.Get() +func (o *Network) GetGatewayv6() (res NetworkGetGatewayv6RetType) { + res, _ = o.GetGatewayv6Ok() + return } // GetGatewayv6Ok returns a tuple with the Gatewayv6 field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Network) GetGatewayv6Ok() (*string, bool) { - if o == nil || IsNil(o.Gatewayv6) { - return nil, false - } - return o.Gatewayv6.Get(), o.Gatewayv6.IsSet() +func (o *Network) GetGatewayv6Ok() (ret NetworkGetGatewayv6RetType, ok bool) { + return getNetworkGetGatewayv6AttributeTypeOk(o.Gatewayv6) } // HasGatewayv6 returns a boolean if a field has been set. func (o *Network) HasGatewayv6() bool { - if o != nil && !IsNil(o.Gatewayv6) && o.Gatewayv6.IsSet() { - return true - } - - return false + _, ok := o.GetGatewayv6Ok() + return ok } // SetGatewayv6 gets a reference to the given string and assigns it to the Gatewayv6 field. -func (o *Network) SetGatewayv6(v *string) { - if IsNil(o.Gatewayv6) { - o.Gatewayv6 = new(NullableString) - } - o.Gatewayv6.Set(v) +func (o *Network) SetGatewayv6(v NetworkGetGatewayv6RetType) { + setNetworkGetGatewayv6AttributeType(&o.Gatewayv6, v) } // SetGatewayv6Nil sets the value for Gatewayv6 to be an explicit nil func (o *Network) SetGatewayv6Nil() { - if IsNil(o.Gatewayv6) { - o.Gatewayv6 = new(NullableString) - } - o.Gatewayv6.Set(nil) + o.Gatewayv6 = nil } // UnsetGatewayv6 ensures that no value is present for Gatewayv6, not even an explicit nil func (o *Network) UnsetGatewayv6() { - if IsNil(o.Gatewayv6) { - o.Gatewayv6 = new(NullableString) - } - o.Gatewayv6.Unset() + o.Gatewayv6 = nil } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *Network) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *Network) GetLabels() (res NetworkGetLabelsRetType) { + 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 *Network) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *Network) GetLabelsOk() (ret NetworkGetLabelsRetType, ok bool) { + return getNetworkGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *Network) 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 *Network) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *Network) SetLabels(v NetworkGetLabelsRetType) { + setNetworkGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value -func (o *Network) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *Network) GetName() (ret NetworkGetNameRetType) { + 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 *Network) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *Network) GetNameOk() (ret NetworkGetNameRetType, ok bool) { + return getNetworkGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *Network) SetName(v *string) { - o.Name = v +func (o *Network) SetName(v NetworkGetNameRetType) { + setNetworkGetNameAttributeType(&o.Name, v) } // GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *Network) GetNameservers() *[]string { - if o == nil || IsNil(o.Nameservers) { - var ret *[]string - return ret - } - return o.Nameservers +func (o *Network) GetNameservers() (res NetworkGetNameserversRetType) { + res, _ = o.GetNameserversOk() + return } // GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Network) GetNameserversOk() (*[]string, bool) { - if o == nil || IsNil(o.Nameservers) { - return nil, false - } - return o.Nameservers, true +func (o *Network) GetNameserversOk() (ret NetworkGetNameserversRetType, ok bool) { + return getNetworkGetNameserversAttributeTypeOk(o.Nameservers) } // HasNameservers returns a boolean if a field has been set. func (o *Network) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { - return true - } - - return false + _, ok := o.GetNameserversOk() + return ok } // SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *Network) SetNameservers(v *[]string) { - o.Nameservers = v +func (o *Network) SetNameservers(v NetworkGetNameserversRetType) { + setNetworkGetNameserversAttributeType(&o.Nameservers, v) } // GetNameserversV6 returns the NameserversV6 field value if set, zero value otherwise. -func (o *Network) GetNameserversV6() *[]string { - if o == nil || IsNil(o.NameserversV6) { - var ret *[]string - return ret - } - return o.NameserversV6 +func (o *Network) GetNameserversV6() (res NetworkGetNameserversV6RetType) { + res, _ = o.GetNameserversV6Ok() + return } // GetNameserversV6Ok returns a tuple with the NameserversV6 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Network) GetNameserversV6Ok() (*[]string, bool) { - if o == nil || IsNil(o.NameserversV6) { - return nil, false - } - return o.NameserversV6, true +func (o *Network) GetNameserversV6Ok() (ret NetworkGetNameserversV6RetType, ok bool) { + return getNetworkGetNameserversV6AttributeTypeOk(o.NameserversV6) } // HasNameserversV6 returns a boolean if a field has been set. func (o *Network) HasNameserversV6() bool { - if o != nil && !IsNil(o.NameserversV6) { - return true - } - - return false + _, ok := o.GetNameserversV6Ok() + return ok } // SetNameserversV6 gets a reference to the given []string and assigns it to the NameserversV6 field. -func (o *Network) SetNameserversV6(v *[]string) { - o.NameserversV6 = v +func (o *Network) SetNameserversV6(v NetworkGetNameserversV6RetType) { + setNetworkGetNameserversV6AttributeType(&o.NameserversV6, v) } // GetNetworkId returns the NetworkId field value -func (o *Network) GetNetworkId() *string { - if o == nil || IsNil(o.NetworkId) { - var ret *string - return ret - } - - return o.NetworkId +func (o *Network) GetNetworkId() (ret NetworkGetNetworkIdRetType) { + ret, _ = o.GetNetworkIdOk() + return ret } // GetNetworkIdOk returns a tuple with the NetworkId field value // and a boolean to check if the value has been set. -func (o *Network) GetNetworkIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.NetworkId, true +func (o *Network) GetNetworkIdOk() (ret NetworkGetNetworkIdRetType, ok bool) { + return getNetworkGetNetworkIdAttributeTypeOk(o.NetworkId) } // SetNetworkId sets field value -func (o *Network) SetNetworkId(v *string) { - o.NetworkId = v +func (o *Network) SetNetworkId(v NetworkGetNetworkIdRetType) { + setNetworkGetNetworkIdAttributeType(&o.NetworkId, v) } // GetPrefixes returns the Prefixes field value if set, zero value otherwise. -func (o *Network) GetPrefixes() *[]string { - if o == nil || IsNil(o.Prefixes) { - var ret *[]string - return ret - } - return o.Prefixes +func (o *Network) GetPrefixes() (res NetworkGetPrefixesRetType) { + res, _ = o.GetPrefixesOk() + return } // GetPrefixesOk returns a tuple with the Prefixes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Network) GetPrefixesOk() (*[]string, bool) { - if o == nil || IsNil(o.Prefixes) { - return nil, false - } - return o.Prefixes, true +func (o *Network) GetPrefixesOk() (ret NetworkGetPrefixesRetType, ok bool) { + return getNetworkGetPrefixesAttributeTypeOk(o.Prefixes) } // HasPrefixes returns a boolean if a field has been set. func (o *Network) HasPrefixes() bool { - if o != nil && !IsNil(o.Prefixes) { - return true - } - - return false + _, ok := o.GetPrefixesOk() + return ok } // SetPrefixes gets a reference to the given []string and assigns it to the Prefixes field. -func (o *Network) SetPrefixes(v *[]string) { - o.Prefixes = v +func (o *Network) SetPrefixes(v NetworkGetPrefixesRetType) { + setNetworkGetPrefixesAttributeType(&o.Prefixes, v) } // GetPrefixesV6 returns the PrefixesV6 field value if set, zero value otherwise. -func (o *Network) GetPrefixesV6() *[]string { - if o == nil || IsNil(o.PrefixesV6) { - var ret *[]string - return ret - } - return o.PrefixesV6 +func (o *Network) GetPrefixesV6() (res NetworkGetPrefixesV6RetType) { + res, _ = o.GetPrefixesV6Ok() + return } // GetPrefixesV6Ok returns a tuple with the PrefixesV6 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Network) GetPrefixesV6Ok() (*[]string, bool) { - if o == nil || IsNil(o.PrefixesV6) { - return nil, false - } - return o.PrefixesV6, true +func (o *Network) GetPrefixesV6Ok() (ret NetworkGetPrefixesV6RetType, ok bool) { + return getNetworkGetPrefixesV6AttributeTypeOk(o.PrefixesV6) } // HasPrefixesV6 returns a boolean if a field has been set. func (o *Network) HasPrefixesV6() bool { - if o != nil && !IsNil(o.PrefixesV6) { - return true - } - - return false + _, ok := o.GetPrefixesV6Ok() + return ok } // SetPrefixesV6 gets a reference to the given []string and assigns it to the PrefixesV6 field. -func (o *Network) SetPrefixesV6(v *[]string) { - o.PrefixesV6 = v +func (o *Network) SetPrefixesV6(v NetworkGetPrefixesV6RetType) { + setNetworkGetPrefixesV6AttributeType(&o.PrefixesV6, v) } // GetPublicIp returns the PublicIp field value if set, zero value otherwise. -func (o *Network) GetPublicIp() *string { - if o == nil || IsNil(o.PublicIp) { - var ret *string - return ret - } - return o.PublicIp +func (o *Network) GetPublicIp() (res NetworkGetPublicIpRetType) { + res, _ = o.GetPublicIpOk() + return } // GetPublicIpOk returns a tuple with the PublicIp field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Network) GetPublicIpOk() (*string, bool) { - if o == nil || IsNil(o.PublicIp) { - return nil, false - } - return o.PublicIp, true +func (o *Network) GetPublicIpOk() (ret NetworkGetPublicIpRetType, ok bool) { + return getNetworkGetPublicIpAttributeTypeOk(o.PublicIp) } // HasPublicIp returns a boolean if a field has been set. func (o *Network) HasPublicIp() bool { - if o != nil && !IsNil(o.PublicIp) { - return true - } - - return false + _, ok := o.GetPublicIpOk() + return ok } // SetPublicIp gets a reference to the given string and assigns it to the PublicIp field. -func (o *Network) SetPublicIp(v *string) { - o.PublicIp = v +func (o *Network) SetPublicIp(v NetworkGetPublicIpRetType) { + setNetworkGetPublicIpAttributeType(&o.PublicIp, v) } // GetRouted returns the Routed field value if set, zero value otherwise. -func (o *Network) GetRouted() *bool { - if o == nil || IsNil(o.Routed) { - var ret *bool - return ret - } - return o.Routed +func (o *Network) GetRouted() (res NetworkgetRoutedRetType) { + res, _ = o.GetRoutedOk() + return } // GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Network) GetRoutedOk() (*bool, bool) { - if o == nil || IsNil(o.Routed) { - return nil, false - } - return o.Routed, true +func (o *Network) GetRoutedOk() (ret NetworkgetRoutedRetType, ok bool) { + return getNetworkgetRoutedAttributeTypeOk(o.Routed) } // HasRouted returns a boolean if a field has been set. func (o *Network) HasRouted() bool { - if o != nil && !IsNil(o.Routed) { - return true - } - - return false + _, ok := o.GetRoutedOk() + return ok } // SetRouted gets a reference to the given bool and assigns it to the Routed field. -func (o *Network) SetRouted(v *bool) { - o.Routed = v +func (o *Network) SetRouted(v NetworkgetRoutedRetType) { + setNetworkgetRoutedAttributeType(&o.Routed, v) } // GetState returns the State field value -func (o *Network) GetState() *string { - if o == nil || IsNil(o.State) { - var ret *string - return ret - } - - return o.State +func (o *Network) GetState() (ret NetworkGetStateRetType) { + ret, _ = o.GetStateOk() + return ret } // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *Network) GetStateOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.State, true +func (o *Network) GetStateOk() (ret NetworkGetStateRetType, ok bool) { + return getNetworkGetStateAttributeTypeOk(o.State) } // SetState sets field value -func (o *Network) SetState(v *string) { - o.State = v +func (o *Network) SetState(v NetworkGetStateRetType) { + setNetworkGetStateAttributeType(&o.State, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *Network) GetUpdatedAt() *time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret *time.Time - return ret - } - return o.UpdatedAt +func (o *Network) GetUpdatedAt() (res NetworkGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Network) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true +func (o *Network) GetUpdatedAtOk() (ret NetworkGetUpdatedAtRetType, ok bool) { + return getNetworkGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. func (o *Network) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false + _, ok := o.GetUpdatedAtOk() + return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *Network) SetUpdatedAt(v *time.Time) { - o.UpdatedAt = v +func (o *Network) SetUpdatedAt(v NetworkGetUpdatedAtRetType) { + setNetworkGetUpdatedAtAttributeType(&o.UpdatedAt, v) } func (o Network) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt + if val, ok := getNetworkGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getNetworkGetGatewayAttributeTypeOk(o.Gateway); ok { + toSerialize["Gateway"] = val + } + if val, ok := getNetworkGetGatewayv6AttributeTypeOk(o.Gatewayv6); ok { + toSerialize["Gatewayv6"] = val + } + if val, ok := getNetworkGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if o.Gateway.IsSet() { - toSerialize["gateway"] = o.Gateway.Get() + if val, ok := getNetworkGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if o.Gatewayv6.IsSet() { - toSerialize["gatewayv6"] = o.Gatewayv6.Get() + if val, ok := getNetworkGetNameserversAttributeTypeOk(o.Nameservers); ok { + toSerialize["Nameservers"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getNetworkGetNameserversV6AttributeTypeOk(o.NameserversV6); ok { + toSerialize["NameserversV6"] = val } - toSerialize["name"] = o.Name - if !IsNil(o.Nameservers) { - toSerialize["nameservers"] = o.Nameservers + if val, ok := getNetworkGetNetworkIdAttributeTypeOk(o.NetworkId); ok { + toSerialize["NetworkId"] = val } - if !IsNil(o.NameserversV6) { - toSerialize["nameserversV6"] = o.NameserversV6 + if val, ok := getNetworkGetPrefixesAttributeTypeOk(o.Prefixes); ok { + toSerialize["Prefixes"] = val } - toSerialize["networkId"] = o.NetworkId - if !IsNil(o.Prefixes) { - toSerialize["prefixes"] = o.Prefixes + if val, ok := getNetworkGetPrefixesV6AttributeTypeOk(o.PrefixesV6); ok { + toSerialize["PrefixesV6"] = val } - if !IsNil(o.PrefixesV6) { - toSerialize["prefixesV6"] = o.PrefixesV6 + if val, ok := getNetworkGetPublicIpAttributeTypeOk(o.PublicIp); ok { + toSerialize["PublicIp"] = val } - if !IsNil(o.PublicIp) { - toSerialize["publicIp"] = o.PublicIp + if val, ok := getNetworkgetRoutedAttributeTypeOk(o.Routed); ok { + toSerialize["Routed"] = val } - if !IsNil(o.Routed) { - toSerialize["routed"] = o.Routed + if val, ok := getNetworkGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val } - toSerialize["state"] = o.State - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt + if val, ok := getNetworkGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val } return toSerialize, nil } diff --git a/services/iaas/model_network_area.go b/services/iaas/model_network_area.go index 143638e62..f72299e4c 100644 --- a/services/iaas/model_network_area.go +++ b/services/iaas/model_network_area.go @@ -18,26 +18,189 @@ import ( // checks if the NetworkArea type satisfies the MappedNullable interface at compile time var _ MappedNullable = &NetworkArea{} +/* + types and functions for areaId +*/ + +// isNotNullableString +type NetworkAreaGetAreaIdAttributeType = *string + +func getNetworkAreaGetAreaIdAttributeTypeOk(arg NetworkAreaGetAreaIdAttributeType) (ret NetworkAreaGetAreaIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkAreaGetAreaIdAttributeType(arg *NetworkAreaGetAreaIdAttributeType, val NetworkAreaGetAreaIdRetType) { + *arg = &val +} + +type NetworkAreaGetAreaIdArgType = string +type NetworkAreaGetAreaIdRetType = string + +/* + types and functions for createdAt +*/ + +// isDateTime +type NetworkAreaGetCreatedAtAttributeType = *time.Time +type NetworkAreaGetCreatedAtArgType = time.Time +type NetworkAreaGetCreatedAtRetType = time.Time + +func getNetworkAreaGetCreatedAtAttributeTypeOk(arg NetworkAreaGetCreatedAtAttributeType) (ret NetworkAreaGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkAreaGetCreatedAtAttributeType(arg *NetworkAreaGetCreatedAtAttributeType, val NetworkAreaGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for ipv4 +*/ + +// isModel +type NetworkAreaGetIpv4AttributeType = *NetworkAreaIPv4 +type NetworkAreaGetIpv4ArgType = NetworkAreaIPv4 +type NetworkAreaGetIpv4RetType = NetworkAreaIPv4 + +func getNetworkAreaGetIpv4AttributeTypeOk(arg NetworkAreaGetIpv4AttributeType) (ret NetworkAreaGetIpv4RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkAreaGetIpv4AttributeType(arg *NetworkAreaGetIpv4AttributeType, val NetworkAreaGetIpv4RetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isFreeform +type NetworkAreaGetLabelsAttributeType = *map[string]interface{} +type NetworkAreaGetLabelsArgType = map[string]interface{} +type NetworkAreaGetLabelsRetType = map[string]interface{} + +func getNetworkAreaGetLabelsAttributeTypeOk(arg NetworkAreaGetLabelsAttributeType) (ret NetworkAreaGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkAreaGetLabelsAttributeType(arg *NetworkAreaGetLabelsAttributeType, val NetworkAreaGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type NetworkAreaGetNameAttributeType = *string + +func getNetworkAreaGetNameAttributeTypeOk(arg NetworkAreaGetNameAttributeType) (ret NetworkAreaGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkAreaGetNameAttributeType(arg *NetworkAreaGetNameAttributeType, val NetworkAreaGetNameRetType) { + *arg = &val +} + +type NetworkAreaGetNameArgType = string +type NetworkAreaGetNameRetType = string + +/* + types and functions for projectCount +*/ + +// isLong +type NetworkAreaGetProjectCountAttributeType = *int64 +type NetworkAreaGetProjectCountArgType = int64 +type NetworkAreaGetProjectCountRetType = int64 + +func getNetworkAreaGetProjectCountAttributeTypeOk(arg NetworkAreaGetProjectCountAttributeType) (ret NetworkAreaGetProjectCountRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkAreaGetProjectCountAttributeType(arg *NetworkAreaGetProjectCountAttributeType, val NetworkAreaGetProjectCountRetType) { + *arg = &val +} + +/* + types and functions for state +*/ + +// isNotNullableString +type NetworkAreaGetStateAttributeType = *string + +func getNetworkAreaGetStateAttributeTypeOk(arg NetworkAreaGetStateAttributeType) (ret NetworkAreaGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkAreaGetStateAttributeType(arg *NetworkAreaGetStateAttributeType, val NetworkAreaGetStateRetType) { + *arg = &val +} + +type NetworkAreaGetStateArgType = string +type NetworkAreaGetStateRetType = string + +/* + types and functions for updatedAt +*/ + +// isDateTime +type NetworkAreaGetUpdatedAtAttributeType = *time.Time +type NetworkAreaGetUpdatedAtArgType = time.Time +type NetworkAreaGetUpdatedAtRetType = time.Time + +func getNetworkAreaGetUpdatedAtAttributeTypeOk(arg NetworkAreaGetUpdatedAtAttributeType) (ret NetworkAreaGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkAreaGetUpdatedAtAttributeType(arg *NetworkAreaGetUpdatedAtAttributeType, val NetworkAreaGetUpdatedAtRetType) { + *arg = &val +} + // NetworkArea Object that represents a network area. type NetworkArea struct { // Universally Unique Identifier (UUID). // REQUIRED - AreaId *string `json:"areaId"` + AreaId NetworkAreaGetAreaIdAttributeType `json:"areaId"` // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` - Ipv4 *NetworkAreaIPv4 `json:"ipv4,omitempty"` + CreatedAt NetworkAreaGetCreatedAtAttributeType `json:"createdAt,omitempty"` + Ipv4 NetworkAreaGetIpv4AttributeType `json:"ipv4,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels NetworkAreaGetLabelsAttributeType `json:"labels,omitempty"` // REQUIRED - Name *string `json:"name"` + Name NetworkAreaGetNameAttributeType `json:"name"` // The amount of projects currently referencing a specific area. // REQUIRED - ProjectCount *int64 `json:"projectCount"` + ProjectCount NetworkAreaGetProjectCountAttributeType `json:"projectCount"` // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. // REQUIRED - State *string `json:"state"` + State NetworkAreaGetStateAttributeType `json:"state"` // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAt NetworkAreaGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } type _NetworkArea NetworkArea @@ -46,12 +209,12 @@ type _NetworkArea NetworkArea // 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 NewNetworkArea(areaId *string, name *string, projectCount *int64, state *string) *NetworkArea { +func NewNetworkArea(areaId NetworkAreaGetAreaIdArgType, name NetworkAreaGetNameArgType, projectCount NetworkAreaGetProjectCountArgType, state NetworkAreaGetStateArgType) *NetworkArea { this := NetworkArea{} - this.AreaId = areaId - this.Name = name - this.ProjectCount = projectCount - this.State = state + setNetworkAreaGetAreaIdAttributeType(&this.AreaId, areaId) + setNetworkAreaGetNameAttributeType(&this.Name, name) + setNetworkAreaGetProjectCountAttributeType(&this.ProjectCount, projectCount) + setNetworkAreaGetStateAttributeType(&this.State, state) return &this } @@ -64,246 +227,190 @@ func NewNetworkAreaWithDefaults() *NetworkArea { } // GetAreaId returns the AreaId field value -func (o *NetworkArea) GetAreaId() *string { - if o == nil || IsNil(o.AreaId) { - var ret *string - return ret - } - - return o.AreaId +func (o *NetworkArea) GetAreaId() (ret NetworkAreaGetAreaIdRetType) { + ret, _ = o.GetAreaIdOk() + return ret } // GetAreaIdOk returns a tuple with the AreaId field value // and a boolean to check if the value has been set. -func (o *NetworkArea) GetAreaIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.AreaId, true +func (o *NetworkArea) GetAreaIdOk() (ret NetworkAreaGetAreaIdRetType, ok bool) { + return getNetworkAreaGetAreaIdAttributeTypeOk(o.AreaId) } // SetAreaId sets field value -func (o *NetworkArea) SetAreaId(v *string) { - o.AreaId = v +func (o *NetworkArea) SetAreaId(v NetworkAreaGetAreaIdRetType) { + setNetworkAreaGetAreaIdAttributeType(&o.AreaId, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *NetworkArea) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - return o.CreatedAt +func (o *NetworkArea) GetCreatedAt() (res NetworkAreaGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return } // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkArea) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true +func (o *NetworkArea) GetCreatedAtOk() (ret NetworkAreaGetCreatedAtRetType, ok bool) { + return getNetworkAreaGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. func (o *NetworkArea) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false + _, ok := o.GetCreatedAtOk() + return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *NetworkArea) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *NetworkArea) SetCreatedAt(v NetworkAreaGetCreatedAtRetType) { + setNetworkAreaGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *NetworkArea) GetIpv4() *NetworkAreaIPv4 { - if o == nil || IsNil(o.Ipv4) { - var ret *NetworkAreaIPv4 - return ret - } - return o.Ipv4 +func (o *NetworkArea) GetIpv4() (res NetworkAreaGetIpv4RetType) { + res, _ = o.GetIpv4Ok() + return } // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkArea) GetIpv4Ok() (*NetworkAreaIPv4, bool) { - if o == nil || IsNil(o.Ipv4) { - return nil, false - } - return o.Ipv4, true +func (o *NetworkArea) GetIpv4Ok() (ret NetworkAreaGetIpv4RetType, ok bool) { + return getNetworkAreaGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. func (o *NetworkArea) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { - return true - } - - return false + _, ok := o.GetIpv4Ok() + return ok } // SetIpv4 gets a reference to the given NetworkAreaIPv4 and assigns it to the Ipv4 field. -func (o *NetworkArea) SetIpv4(v *NetworkAreaIPv4) { - o.Ipv4 = v +func (o *NetworkArea) SetIpv4(v NetworkAreaGetIpv4RetType) { + setNetworkAreaGetIpv4AttributeType(&o.Ipv4, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *NetworkArea) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *NetworkArea) GetLabels() (res NetworkAreaGetLabelsRetType) { + 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 *NetworkArea) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *NetworkArea) GetLabelsOk() (ret NetworkAreaGetLabelsRetType, ok bool) { + return getNetworkAreaGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *NetworkArea) 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 *NetworkArea) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *NetworkArea) SetLabels(v NetworkAreaGetLabelsRetType) { + setNetworkAreaGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value -func (o *NetworkArea) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *NetworkArea) GetName() (ret NetworkAreaGetNameRetType) { + 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 *NetworkArea) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *NetworkArea) GetNameOk() (ret NetworkAreaGetNameRetType, ok bool) { + return getNetworkAreaGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *NetworkArea) SetName(v *string) { - o.Name = v +func (o *NetworkArea) SetName(v NetworkAreaGetNameRetType) { + setNetworkAreaGetNameAttributeType(&o.Name, v) } // GetProjectCount returns the ProjectCount field value -func (o *NetworkArea) GetProjectCount() *int64 { - if o == nil || IsNil(o.ProjectCount) { - var ret *int64 - return ret - } - - return o.ProjectCount +func (o *NetworkArea) GetProjectCount() (ret NetworkAreaGetProjectCountRetType) { + ret, _ = o.GetProjectCountOk() + return ret } // GetProjectCountOk returns a tuple with the ProjectCount field value // and a boolean to check if the value has been set. -func (o *NetworkArea) GetProjectCountOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.ProjectCount, true +func (o *NetworkArea) GetProjectCountOk() (ret NetworkAreaGetProjectCountRetType, ok bool) { + return getNetworkAreaGetProjectCountAttributeTypeOk(o.ProjectCount) } // SetProjectCount sets field value -func (o *NetworkArea) SetProjectCount(v *int64) { - o.ProjectCount = v +func (o *NetworkArea) SetProjectCount(v NetworkAreaGetProjectCountRetType) { + setNetworkAreaGetProjectCountAttributeType(&o.ProjectCount, v) } // GetState returns the State field value -func (o *NetworkArea) GetState() *string { - if o == nil || IsNil(o.State) { - var ret *string - return ret - } - - return o.State +func (o *NetworkArea) GetState() (ret NetworkAreaGetStateRetType) { + ret, _ = o.GetStateOk() + return ret } // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. -func (o *NetworkArea) GetStateOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.State, true +func (o *NetworkArea) GetStateOk() (ret NetworkAreaGetStateRetType, ok bool) { + return getNetworkAreaGetStateAttributeTypeOk(o.State) } // SetState sets field value -func (o *NetworkArea) SetState(v *string) { - o.State = v +func (o *NetworkArea) SetState(v NetworkAreaGetStateRetType) { + setNetworkAreaGetStateAttributeType(&o.State, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *NetworkArea) GetUpdatedAt() *time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret *time.Time - return ret - } - return o.UpdatedAt +func (o *NetworkArea) GetUpdatedAt() (res NetworkAreaGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkArea) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true +func (o *NetworkArea) GetUpdatedAtOk() (ret NetworkAreaGetUpdatedAtRetType, ok bool) { + return getNetworkAreaGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. func (o *NetworkArea) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false + _, ok := o.GetUpdatedAtOk() + return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *NetworkArea) SetUpdatedAt(v *time.Time) { - o.UpdatedAt = v +func (o *NetworkArea) SetUpdatedAt(v NetworkAreaGetUpdatedAtRetType) { + setNetworkAreaGetUpdatedAtAttributeType(&o.UpdatedAt, v) } func (o NetworkArea) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["areaId"] = o.AreaId - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt + if val, ok := getNetworkAreaGetAreaIdAttributeTypeOk(o.AreaId); ok { + toSerialize["AreaId"] = val + } + if val, ok := getNetworkAreaGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getNetworkAreaGetIpv4AttributeTypeOk(o.Ipv4); ok { + toSerialize["Ipv4"] = val + } + if val, ok := getNetworkAreaGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getNetworkAreaGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Ipv4) { - toSerialize["ipv4"] = o.Ipv4 + if val, ok := getNetworkAreaGetProjectCountAttributeTypeOk(o.ProjectCount); ok { + toSerialize["ProjectCount"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getNetworkAreaGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val } - toSerialize["name"] = o.Name - toSerialize["projectCount"] = o.ProjectCount - toSerialize["state"] = o.State - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt + if val, ok := getNetworkAreaGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val } return toSerialize, nil } diff --git a/services/iaas/model_network_area_ipv4.go b/services/iaas/model_network_area_ipv4.go index 7e7358d56..dfb5495b5 100644 --- a/services/iaas/model_network_area_ipv4.go +++ b/services/iaas/model_network_area_ipv4.go @@ -17,22 +17,163 @@ import ( // checks if the NetworkAreaIPv4 type satisfies the MappedNullable interface at compile time var _ MappedNullable = &NetworkAreaIPv4{} +/* + types and functions for defaultNameservers +*/ + +// isArray +type NetworkAreaIPv4GetDefaultNameserversAttributeType = *[]string +type NetworkAreaIPv4GetDefaultNameserversArgType = []string +type NetworkAreaIPv4GetDefaultNameserversRetType = []string + +func getNetworkAreaIPv4GetDefaultNameserversAttributeTypeOk(arg NetworkAreaIPv4GetDefaultNameserversAttributeType) (ret NetworkAreaIPv4GetDefaultNameserversRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkAreaIPv4GetDefaultNameserversAttributeType(arg *NetworkAreaIPv4GetDefaultNameserversAttributeType, val NetworkAreaIPv4GetDefaultNameserversRetType) { + *arg = &val +} + +/* + types and functions for networkRanges +*/ + +// isArray +type NetworkAreaIPv4GetNetworkRangesAttributeType = *[]NetworkRange +type NetworkAreaIPv4GetNetworkRangesArgType = []NetworkRange +type NetworkAreaIPv4GetNetworkRangesRetType = []NetworkRange + +func getNetworkAreaIPv4GetNetworkRangesAttributeTypeOk(arg NetworkAreaIPv4GetNetworkRangesAttributeType) (ret NetworkAreaIPv4GetNetworkRangesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkAreaIPv4GetNetworkRangesAttributeType(arg *NetworkAreaIPv4GetNetworkRangesAttributeType, val NetworkAreaIPv4GetNetworkRangesRetType) { + *arg = &val +} + +/* + types and functions for routes +*/ + +// isArray +type NetworkAreaIPv4GetRoutesAttributeType = *[]Route +type NetworkAreaIPv4GetRoutesArgType = []Route +type NetworkAreaIPv4GetRoutesRetType = []Route + +func getNetworkAreaIPv4GetRoutesAttributeTypeOk(arg NetworkAreaIPv4GetRoutesAttributeType) (ret NetworkAreaIPv4GetRoutesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkAreaIPv4GetRoutesAttributeType(arg *NetworkAreaIPv4GetRoutesAttributeType, val NetworkAreaIPv4GetRoutesRetType) { + *arg = &val +} + +/* + types and functions for transferNetwork +*/ + +// isNotNullableString +type NetworkAreaIPv4GetTransferNetworkAttributeType = *string + +func getNetworkAreaIPv4GetTransferNetworkAttributeTypeOk(arg NetworkAreaIPv4GetTransferNetworkAttributeType) (ret NetworkAreaIPv4GetTransferNetworkRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkAreaIPv4GetTransferNetworkAttributeType(arg *NetworkAreaIPv4GetTransferNetworkAttributeType, val NetworkAreaIPv4GetTransferNetworkRetType) { + *arg = &val +} + +type NetworkAreaIPv4GetTransferNetworkArgType = string +type NetworkAreaIPv4GetTransferNetworkRetType = string + +/* + types and functions for defaultPrefixLen +*/ + +// isInteger +type NetworkAreaIPv4GetDefaultPrefixLenAttributeType = *int64 +type NetworkAreaIPv4GetDefaultPrefixLenArgType = int64 +type NetworkAreaIPv4GetDefaultPrefixLenRetType = int64 + +func getNetworkAreaIPv4GetDefaultPrefixLenAttributeTypeOk(arg NetworkAreaIPv4GetDefaultPrefixLenAttributeType) (ret NetworkAreaIPv4GetDefaultPrefixLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkAreaIPv4GetDefaultPrefixLenAttributeType(arg *NetworkAreaIPv4GetDefaultPrefixLenAttributeType, val NetworkAreaIPv4GetDefaultPrefixLenRetType) { + *arg = &val +} + +/* + types and functions for maxPrefixLen +*/ + +// isInteger +type NetworkAreaIPv4GetMaxPrefixLenAttributeType = *int64 +type NetworkAreaIPv4GetMaxPrefixLenArgType = int64 +type NetworkAreaIPv4GetMaxPrefixLenRetType = int64 + +func getNetworkAreaIPv4GetMaxPrefixLenAttributeTypeOk(arg NetworkAreaIPv4GetMaxPrefixLenAttributeType) (ret NetworkAreaIPv4GetMaxPrefixLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkAreaIPv4GetMaxPrefixLenAttributeType(arg *NetworkAreaIPv4GetMaxPrefixLenAttributeType, val NetworkAreaIPv4GetMaxPrefixLenRetType) { + *arg = &val +} + +/* + types and functions for minPrefixLen +*/ + +// isInteger +type NetworkAreaIPv4GetMinPrefixLenAttributeType = *int64 +type NetworkAreaIPv4GetMinPrefixLenArgType = int64 +type NetworkAreaIPv4GetMinPrefixLenRetType = int64 + +func getNetworkAreaIPv4GetMinPrefixLenAttributeTypeOk(arg NetworkAreaIPv4GetMinPrefixLenAttributeType) (ret NetworkAreaIPv4GetMinPrefixLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkAreaIPv4GetMinPrefixLenAttributeType(arg *NetworkAreaIPv4GetMinPrefixLenAttributeType, val NetworkAreaIPv4GetMinPrefixLenRetType) { + *arg = &val +} + // NetworkAreaIPv4 The IPv4 properties of a network area. type NetworkAreaIPv4 struct { // A list containing DNS Servers/Nameservers for IPv4. - DefaultNameservers *[]string `json:"defaultNameservers,omitempty"` + DefaultNameservers NetworkAreaIPv4GetDefaultNameserversAttributeType `json:"defaultNameservers,omitempty"` // A list of network ranges. - NetworkRanges *[]NetworkRange `json:"networkRanges,omitempty"` + NetworkRanges NetworkAreaIPv4GetNetworkRangesAttributeType `json:"networkRanges,omitempty"` // A list of routes. - Routes *[]Route `json:"routes,omitempty"` + Routes NetworkAreaIPv4GetRoutesAttributeType `json:"routes,omitempty"` // Classless Inter-Domain Routing (CIDR). - TransferNetwork *string `json:"transferNetwork,omitempty"` + TransferNetwork NetworkAreaIPv4GetTransferNetworkAttributeType `json:"transferNetwork,omitempty"` // The default prefix length for networks in the network area. - DefaultPrefixLen *int64 `json:"defaultPrefixLen,omitempty"` + DefaultPrefixLen NetworkAreaIPv4GetDefaultPrefixLenAttributeType `json:"defaultPrefixLen,omitempty"` // The maximal prefix length for networks in the network area. - MaxPrefixLen *int64 `json:"maxPrefixLen,omitempty"` + MaxPrefixLen NetworkAreaIPv4GetMaxPrefixLenAttributeType `json:"maxPrefixLen,omitempty"` // The minimal prefix length for networks in the network area. - MinPrefixLen *int64 `json:"minPrefixLen,omitempty"` + MinPrefixLen NetworkAreaIPv4GetMinPrefixLenAttributeType `json:"minPrefixLen,omitempty"` } // NewNetworkAreaIPv4 instantiates a new NetworkAreaIPv4 object @@ -41,12 +182,6 @@ type NetworkAreaIPv4 struct { // will change when the set of required properties is changed func NewNetworkAreaIPv4() *NetworkAreaIPv4 { this := NetworkAreaIPv4{} - var defaultPrefixLen int64 = 25 - this.DefaultPrefixLen = &defaultPrefixLen - var maxPrefixLen int64 = 29 - this.MaxPrefixLen = &maxPrefixLen - var minPrefixLen int64 = 24 - this.MinPrefixLen = &minPrefixLen return &this } @@ -65,251 +200,188 @@ func NewNetworkAreaIPv4WithDefaults() *NetworkAreaIPv4 { } // GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. -func (o *NetworkAreaIPv4) GetDefaultNameservers() *[]string { - if o == nil || IsNil(o.DefaultNameservers) { - var ret *[]string - return ret - } - return o.DefaultNameservers +func (o *NetworkAreaIPv4) GetDefaultNameservers() (res NetworkAreaIPv4GetDefaultNameserversRetType) { + res, _ = o.GetDefaultNameserversOk() + return } // GetDefaultNameserversOk returns a tuple with the DefaultNameservers field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkAreaIPv4) GetDefaultNameserversOk() (*[]string, bool) { - if o == nil || IsNil(o.DefaultNameservers) { - return nil, false - } - return o.DefaultNameservers, true +func (o *NetworkAreaIPv4) GetDefaultNameserversOk() (ret NetworkAreaIPv4GetDefaultNameserversRetType, ok bool) { + return getNetworkAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers) } // HasDefaultNameservers returns a boolean if a field has been set. func (o *NetworkAreaIPv4) HasDefaultNameservers() bool { - if o != nil && !IsNil(o.DefaultNameservers) { - return true - } - - return false + _, ok := o.GetDefaultNameserversOk() + return ok } // SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. -func (o *NetworkAreaIPv4) SetDefaultNameservers(v *[]string) { - o.DefaultNameservers = v +func (o *NetworkAreaIPv4) SetDefaultNameservers(v NetworkAreaIPv4GetDefaultNameserversRetType) { + setNetworkAreaIPv4GetDefaultNameserversAttributeType(&o.DefaultNameservers, v) } // GetNetworkRanges returns the NetworkRanges field value if set, zero value otherwise. -func (o *NetworkAreaIPv4) GetNetworkRanges() *[]NetworkRange { - if o == nil || IsNil(o.NetworkRanges) { - var ret *[]NetworkRange - return ret - } - return o.NetworkRanges +func (o *NetworkAreaIPv4) GetNetworkRanges() (res NetworkAreaIPv4GetNetworkRangesRetType) { + res, _ = o.GetNetworkRangesOk() + return } // GetNetworkRangesOk returns a tuple with the NetworkRanges field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkAreaIPv4) GetNetworkRangesOk() (*[]NetworkRange, bool) { - if o == nil || IsNil(o.NetworkRanges) { - return nil, false - } - return o.NetworkRanges, true +func (o *NetworkAreaIPv4) GetNetworkRangesOk() (ret NetworkAreaIPv4GetNetworkRangesRetType, ok bool) { + return getNetworkAreaIPv4GetNetworkRangesAttributeTypeOk(o.NetworkRanges) } // HasNetworkRanges returns a boolean if a field has been set. func (o *NetworkAreaIPv4) HasNetworkRanges() bool { - if o != nil && !IsNil(o.NetworkRanges) { - return true - } - - return false + _, ok := o.GetNetworkRangesOk() + return ok } // SetNetworkRanges gets a reference to the given []NetworkRange and assigns it to the NetworkRanges field. -func (o *NetworkAreaIPv4) SetNetworkRanges(v *[]NetworkRange) { - o.NetworkRanges = v +func (o *NetworkAreaIPv4) SetNetworkRanges(v NetworkAreaIPv4GetNetworkRangesRetType) { + setNetworkAreaIPv4GetNetworkRangesAttributeType(&o.NetworkRanges, v) } // GetRoutes returns the Routes field value if set, zero value otherwise. -func (o *NetworkAreaIPv4) GetRoutes() *[]Route { - if o == nil || IsNil(o.Routes) { - var ret *[]Route - return ret - } - return o.Routes +func (o *NetworkAreaIPv4) GetRoutes() (res NetworkAreaIPv4GetRoutesRetType) { + res, _ = o.GetRoutesOk() + return } // GetRoutesOk returns a tuple with the Routes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkAreaIPv4) GetRoutesOk() (*[]Route, bool) { - if o == nil || IsNil(o.Routes) { - return nil, false - } - return o.Routes, true +func (o *NetworkAreaIPv4) GetRoutesOk() (ret NetworkAreaIPv4GetRoutesRetType, ok bool) { + return getNetworkAreaIPv4GetRoutesAttributeTypeOk(o.Routes) } // HasRoutes returns a boolean if a field has been set. func (o *NetworkAreaIPv4) HasRoutes() bool { - if o != nil && !IsNil(o.Routes) { - return true - } - - return false + _, ok := o.GetRoutesOk() + return ok } // SetRoutes gets a reference to the given []Route and assigns it to the Routes field. -func (o *NetworkAreaIPv4) SetRoutes(v *[]Route) { - o.Routes = v +func (o *NetworkAreaIPv4) SetRoutes(v NetworkAreaIPv4GetRoutesRetType) { + setNetworkAreaIPv4GetRoutesAttributeType(&o.Routes, v) } // GetTransferNetwork returns the TransferNetwork field value if set, zero value otherwise. -func (o *NetworkAreaIPv4) GetTransferNetwork() *string { - if o == nil || IsNil(o.TransferNetwork) { - var ret *string - return ret - } - return o.TransferNetwork +func (o *NetworkAreaIPv4) GetTransferNetwork() (res NetworkAreaIPv4GetTransferNetworkRetType) { + res, _ = o.GetTransferNetworkOk() + return } // GetTransferNetworkOk returns a tuple with the TransferNetwork field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkAreaIPv4) GetTransferNetworkOk() (*string, bool) { - if o == nil || IsNil(o.TransferNetwork) { - return nil, false - } - return o.TransferNetwork, true +func (o *NetworkAreaIPv4) GetTransferNetworkOk() (ret NetworkAreaIPv4GetTransferNetworkRetType, ok bool) { + return getNetworkAreaIPv4GetTransferNetworkAttributeTypeOk(o.TransferNetwork) } // HasTransferNetwork returns a boolean if a field has been set. func (o *NetworkAreaIPv4) HasTransferNetwork() bool { - if o != nil && !IsNil(o.TransferNetwork) { - return true - } - - return false + _, ok := o.GetTransferNetworkOk() + return ok } // SetTransferNetwork gets a reference to the given string and assigns it to the TransferNetwork field. -func (o *NetworkAreaIPv4) SetTransferNetwork(v *string) { - o.TransferNetwork = v +func (o *NetworkAreaIPv4) SetTransferNetwork(v NetworkAreaIPv4GetTransferNetworkRetType) { + setNetworkAreaIPv4GetTransferNetworkAttributeType(&o.TransferNetwork, v) } // GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. -func (o *NetworkAreaIPv4) GetDefaultPrefixLen() *int64 { - if o == nil || IsNil(o.DefaultPrefixLen) { - var ret *int64 - return ret - } - return o.DefaultPrefixLen +func (o *NetworkAreaIPv4) GetDefaultPrefixLen() (res NetworkAreaIPv4GetDefaultPrefixLenRetType) { + res, _ = o.GetDefaultPrefixLenOk() + return } // GetDefaultPrefixLenOk returns a tuple with the DefaultPrefixLen field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkAreaIPv4) GetDefaultPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.DefaultPrefixLen) { - return nil, false - } - return o.DefaultPrefixLen, true +func (o *NetworkAreaIPv4) GetDefaultPrefixLenOk() (ret NetworkAreaIPv4GetDefaultPrefixLenRetType, ok bool) { + return getNetworkAreaIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen) } // HasDefaultPrefixLen returns a boolean if a field has been set. func (o *NetworkAreaIPv4) HasDefaultPrefixLen() bool { - if o != nil && !IsNil(o.DefaultPrefixLen) { - return true - } - - return false + _, ok := o.GetDefaultPrefixLenOk() + return ok } // SetDefaultPrefixLen gets a reference to the given int64 and assigns it to the DefaultPrefixLen field. -func (o *NetworkAreaIPv4) SetDefaultPrefixLen(v *int64) { - o.DefaultPrefixLen = v +func (o *NetworkAreaIPv4) SetDefaultPrefixLen(v NetworkAreaIPv4GetDefaultPrefixLenRetType) { + setNetworkAreaIPv4GetDefaultPrefixLenAttributeType(&o.DefaultPrefixLen, v) } // GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. -func (o *NetworkAreaIPv4) GetMaxPrefixLen() *int64 { - if o == nil || IsNil(o.MaxPrefixLen) { - var ret *int64 - return ret - } - return o.MaxPrefixLen +func (o *NetworkAreaIPv4) GetMaxPrefixLen() (res NetworkAreaIPv4GetMaxPrefixLenRetType) { + res, _ = o.GetMaxPrefixLenOk() + return } // GetMaxPrefixLenOk returns a tuple with the MaxPrefixLen field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkAreaIPv4) GetMaxPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MaxPrefixLen) { - return nil, false - } - return o.MaxPrefixLen, true +func (o *NetworkAreaIPv4) GetMaxPrefixLenOk() (ret NetworkAreaIPv4GetMaxPrefixLenRetType, ok bool) { + return getNetworkAreaIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen) } // HasMaxPrefixLen returns a boolean if a field has been set. func (o *NetworkAreaIPv4) HasMaxPrefixLen() bool { - if o != nil && !IsNil(o.MaxPrefixLen) { - return true - } - - return false + _, ok := o.GetMaxPrefixLenOk() + return ok } // SetMaxPrefixLen gets a reference to the given int64 and assigns it to the MaxPrefixLen field. -func (o *NetworkAreaIPv4) SetMaxPrefixLen(v *int64) { - o.MaxPrefixLen = v +func (o *NetworkAreaIPv4) SetMaxPrefixLen(v NetworkAreaIPv4GetMaxPrefixLenRetType) { + setNetworkAreaIPv4GetMaxPrefixLenAttributeType(&o.MaxPrefixLen, v) } // GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. -func (o *NetworkAreaIPv4) GetMinPrefixLen() *int64 { - if o == nil || IsNil(o.MinPrefixLen) { - var ret *int64 - return ret - } - return o.MinPrefixLen +func (o *NetworkAreaIPv4) GetMinPrefixLen() (res NetworkAreaIPv4GetMinPrefixLenRetType) { + res, _ = o.GetMinPrefixLenOk() + return } // GetMinPrefixLenOk returns a tuple with the MinPrefixLen field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkAreaIPv4) GetMinPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MinPrefixLen) { - return nil, false - } - return o.MinPrefixLen, true +func (o *NetworkAreaIPv4) GetMinPrefixLenOk() (ret NetworkAreaIPv4GetMinPrefixLenRetType, ok bool) { + return getNetworkAreaIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen) } // HasMinPrefixLen returns a boolean if a field has been set. func (o *NetworkAreaIPv4) HasMinPrefixLen() bool { - if o != nil && !IsNil(o.MinPrefixLen) { - return true - } - - return false + _, ok := o.GetMinPrefixLenOk() + return ok } // SetMinPrefixLen gets a reference to the given int64 and assigns it to the MinPrefixLen field. -func (o *NetworkAreaIPv4) SetMinPrefixLen(v *int64) { - o.MinPrefixLen = v +func (o *NetworkAreaIPv4) SetMinPrefixLen(v NetworkAreaIPv4GetMinPrefixLenRetType) { + setNetworkAreaIPv4GetMinPrefixLenAttributeType(&o.MinPrefixLen, v) } func (o NetworkAreaIPv4) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.DefaultNameservers) { - toSerialize["defaultNameservers"] = o.DefaultNameservers + if val, ok := getNetworkAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers); ok { + toSerialize["DefaultNameservers"] = val } - if !IsNil(o.NetworkRanges) { - toSerialize["networkRanges"] = o.NetworkRanges + if val, ok := getNetworkAreaIPv4GetNetworkRangesAttributeTypeOk(o.NetworkRanges); ok { + toSerialize["NetworkRanges"] = val } - if !IsNil(o.Routes) { - toSerialize["routes"] = o.Routes + if val, ok := getNetworkAreaIPv4GetRoutesAttributeTypeOk(o.Routes); ok { + toSerialize["Routes"] = val } - if !IsNil(o.TransferNetwork) { - toSerialize["transferNetwork"] = o.TransferNetwork + if val, ok := getNetworkAreaIPv4GetTransferNetworkAttributeTypeOk(o.TransferNetwork); ok { + toSerialize["TransferNetwork"] = val } - if !IsNil(o.DefaultPrefixLen) { - toSerialize["defaultPrefixLen"] = o.DefaultPrefixLen + if val, ok := getNetworkAreaIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen); ok { + toSerialize["DefaultPrefixLen"] = val } - if !IsNil(o.MaxPrefixLen) { - toSerialize["maxPrefixLen"] = o.MaxPrefixLen + if val, ok := getNetworkAreaIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen); ok { + toSerialize["MaxPrefixLen"] = val } - if !IsNil(o.MinPrefixLen) { - toSerialize["minPrefixLen"] = o.MinPrefixLen + if val, ok := getNetworkAreaIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen); ok { + toSerialize["MinPrefixLen"] = val } return toSerialize, nil } diff --git a/services/iaas/model_network_area_list_response.go b/services/iaas/model_network_area_list_response.go index 9478ec961..040bd780c 100644 --- a/services/iaas/model_network_area_list_response.go +++ b/services/iaas/model_network_area_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the NetworkAreaListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &NetworkAreaListResponse{} +/* + types and functions for items +*/ + +// isArray +type NetworkAreaListResponseGetItemsAttributeType = *[]NetworkArea +type NetworkAreaListResponseGetItemsArgType = []NetworkArea +type NetworkAreaListResponseGetItemsRetType = []NetworkArea + +func getNetworkAreaListResponseGetItemsAttributeTypeOk(arg NetworkAreaListResponseGetItemsAttributeType) (ret NetworkAreaListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkAreaListResponseGetItemsAttributeType(arg *NetworkAreaListResponseGetItemsAttributeType, val NetworkAreaListResponseGetItemsRetType) { + *arg = &val +} + // NetworkAreaListResponse Network area list response. type NetworkAreaListResponse struct { // A list of network areas. // REQUIRED - Items *[]NetworkArea `json:"items"` + Items NetworkAreaListResponseGetItemsAttributeType `json:"items"` } type _NetworkAreaListResponse NetworkAreaListResponse @@ -30,9 +50,9 @@ type _NetworkAreaListResponse NetworkAreaListResponse // 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 NewNetworkAreaListResponse(items *[]NetworkArea) *NetworkAreaListResponse { +func NewNetworkAreaListResponse(items NetworkAreaListResponseGetItemsArgType) *NetworkAreaListResponse { this := NetworkAreaListResponse{} - this.Items = items + setNetworkAreaListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewNetworkAreaListResponseWithDefaults() *NetworkAreaListResponse { } // GetItems returns the Items field value -func (o *NetworkAreaListResponse) GetItems() *[]NetworkArea { - if o == nil || IsNil(o.Items) { - var ret *[]NetworkArea - return ret - } - - return o.Items +func (o *NetworkAreaListResponse) GetItems() (ret NetworkAreaListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *NetworkAreaListResponse) GetItemsOk() (*[]NetworkArea, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *NetworkAreaListResponse) GetItemsOk() (ret NetworkAreaListResponseGetItemsRetType, ok bool) { + return getNetworkAreaListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *NetworkAreaListResponse) SetItems(v *[]NetworkArea) { - o.Items = v +func (o *NetworkAreaListResponse) SetItems(v NetworkAreaListResponseGetItemsRetType) { + setNetworkAreaListResponseGetItemsAttributeType(&o.Items, v) } func (o NetworkAreaListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getNetworkAreaListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_network_list_response.go b/services/iaas/model_network_list_response.go index 66ef63df1..3fade9994 100644 --- a/services/iaas/model_network_list_response.go +++ b/services/iaas/model_network_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the NetworkListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &NetworkListResponse{} +/* + types and functions for items +*/ + +// isArray +type NetworkListResponseGetItemsAttributeType = *[]Network +type NetworkListResponseGetItemsArgType = []Network +type NetworkListResponseGetItemsRetType = []Network + +func getNetworkListResponseGetItemsAttributeTypeOk(arg NetworkListResponseGetItemsAttributeType) (ret NetworkListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkListResponseGetItemsAttributeType(arg *NetworkListResponseGetItemsAttributeType, val NetworkListResponseGetItemsRetType) { + *arg = &val +} + // NetworkListResponse Network list response. type NetworkListResponse struct { // A list of networks. // REQUIRED - Items *[]Network `json:"items"` + Items NetworkListResponseGetItemsAttributeType `json:"items"` } type _NetworkListResponse NetworkListResponse @@ -30,9 +50,9 @@ type _NetworkListResponse NetworkListResponse // 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 NewNetworkListResponse(items *[]Network) *NetworkListResponse { +func NewNetworkListResponse(items NetworkListResponseGetItemsArgType) *NetworkListResponse { this := NetworkListResponse{} - this.Items = items + setNetworkListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewNetworkListResponseWithDefaults() *NetworkListResponse { } // GetItems returns the Items field value -func (o *NetworkListResponse) GetItems() *[]Network { - if o == nil || IsNil(o.Items) { - var ret *[]Network - return ret - } - - return o.Items +func (o *NetworkListResponse) GetItems() (ret NetworkListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *NetworkListResponse) GetItemsOk() (*[]Network, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *NetworkListResponse) GetItemsOk() (ret NetworkListResponseGetItemsRetType, ok bool) { + return getNetworkListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *NetworkListResponse) SetItems(v *[]Network) { - o.Items = v +func (o *NetworkListResponse) SetItems(v NetworkListResponseGetItemsRetType) { + setNetworkListResponseGetItemsAttributeType(&o.Items, v) } func (o NetworkListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getNetworkListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_network_range.go b/services/iaas/model_network_range.go index 6b9b9a031..f2575aed9 100644 --- a/services/iaas/model_network_range.go +++ b/services/iaas/model_network_range.go @@ -18,17 +18,99 @@ import ( // checks if the NetworkRange type satisfies the MappedNullable interface at compile time var _ MappedNullable = &NetworkRange{} +/* + types and functions for createdAt +*/ + +// isDateTime +type NetworkRangeGetCreatedAtAttributeType = *time.Time +type NetworkRangeGetCreatedAtArgType = time.Time +type NetworkRangeGetCreatedAtRetType = time.Time + +func getNetworkRangeGetCreatedAtAttributeTypeOk(arg NetworkRangeGetCreatedAtAttributeType) (ret NetworkRangeGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkRangeGetCreatedAtAttributeType(arg *NetworkRangeGetCreatedAtAttributeType, val NetworkRangeGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for networkRangeId +*/ + +// isNotNullableString +type NetworkRangeGetNetworkRangeIdAttributeType = *string + +func getNetworkRangeGetNetworkRangeIdAttributeTypeOk(arg NetworkRangeGetNetworkRangeIdAttributeType) (ret NetworkRangeGetNetworkRangeIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkRangeGetNetworkRangeIdAttributeType(arg *NetworkRangeGetNetworkRangeIdAttributeType, val NetworkRangeGetNetworkRangeIdRetType) { + *arg = &val +} + +type NetworkRangeGetNetworkRangeIdArgType = string +type NetworkRangeGetNetworkRangeIdRetType = string + +/* + types and functions for prefix +*/ + +// isNotNullableString +type NetworkRangeGetPrefixAttributeType = *string + +func getNetworkRangeGetPrefixAttributeTypeOk(arg NetworkRangeGetPrefixAttributeType) (ret NetworkRangeGetPrefixRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkRangeGetPrefixAttributeType(arg *NetworkRangeGetPrefixAttributeType, val NetworkRangeGetPrefixRetType) { + *arg = &val +} + +type NetworkRangeGetPrefixArgType = string +type NetworkRangeGetPrefixRetType = string + +/* + types and functions for updatedAt +*/ + +// isDateTime +type NetworkRangeGetUpdatedAtAttributeType = *time.Time +type NetworkRangeGetUpdatedAtArgType = time.Time +type NetworkRangeGetUpdatedAtRetType = time.Time + +func getNetworkRangeGetUpdatedAtAttributeTypeOk(arg NetworkRangeGetUpdatedAtAttributeType) (ret NetworkRangeGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkRangeGetUpdatedAtAttributeType(arg *NetworkRangeGetUpdatedAtAttributeType, val NetworkRangeGetUpdatedAtRetType) { + *arg = &val +} + // NetworkRange Object that represents a network range. type NetworkRange struct { // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt NetworkRangeGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Universally Unique Identifier (UUID). - NetworkRangeId *string `json:"networkRangeId,omitempty"` + NetworkRangeId NetworkRangeGetNetworkRangeIdAttributeType `json:"networkRangeId,omitempty"` // Classless Inter-Domain Routing (CIDR). // REQUIRED - Prefix *string `json:"prefix"` + Prefix NetworkRangeGetPrefixAttributeType `json:"prefix"` // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAt NetworkRangeGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } type _NetworkRange NetworkRange @@ -37,9 +119,9 @@ type _NetworkRange NetworkRange // 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 NewNetworkRange(prefix *string) *NetworkRange { +func NewNetworkRange(prefix NetworkRangeGetPrefixArgType) *NetworkRange { this := NetworkRange{} - this.Prefix = prefix + setNetworkRangeGetPrefixAttributeType(&this.Prefix, prefix) return &this } @@ -52,136 +134,104 @@ func NewNetworkRangeWithDefaults() *NetworkRange { } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *NetworkRange) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - return o.CreatedAt +func (o *NetworkRange) GetCreatedAt() (res NetworkRangeGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return } // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkRange) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true +func (o *NetworkRange) GetCreatedAtOk() (ret NetworkRangeGetCreatedAtRetType, ok bool) { + return getNetworkRangeGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. func (o *NetworkRange) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false + _, ok := o.GetCreatedAtOk() + return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *NetworkRange) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *NetworkRange) SetCreatedAt(v NetworkRangeGetCreatedAtRetType) { + setNetworkRangeGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetNetworkRangeId returns the NetworkRangeId field value if set, zero value otherwise. -func (o *NetworkRange) GetNetworkRangeId() *string { - if o == nil || IsNil(o.NetworkRangeId) { - var ret *string - return ret - } - return o.NetworkRangeId +func (o *NetworkRange) GetNetworkRangeId() (res NetworkRangeGetNetworkRangeIdRetType) { + res, _ = o.GetNetworkRangeIdOk() + return } // GetNetworkRangeIdOk returns a tuple with the NetworkRangeId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkRange) GetNetworkRangeIdOk() (*string, bool) { - if o == nil || IsNil(o.NetworkRangeId) { - return nil, false - } - return o.NetworkRangeId, true +func (o *NetworkRange) GetNetworkRangeIdOk() (ret NetworkRangeGetNetworkRangeIdRetType, ok bool) { + return getNetworkRangeGetNetworkRangeIdAttributeTypeOk(o.NetworkRangeId) } // HasNetworkRangeId returns a boolean if a field has been set. func (o *NetworkRange) HasNetworkRangeId() bool { - if o != nil && !IsNil(o.NetworkRangeId) { - return true - } - - return false + _, ok := o.GetNetworkRangeIdOk() + return ok } // SetNetworkRangeId gets a reference to the given string and assigns it to the NetworkRangeId field. -func (o *NetworkRange) SetNetworkRangeId(v *string) { - o.NetworkRangeId = v +func (o *NetworkRange) SetNetworkRangeId(v NetworkRangeGetNetworkRangeIdRetType) { + setNetworkRangeGetNetworkRangeIdAttributeType(&o.NetworkRangeId, v) } // GetPrefix returns the Prefix field value -func (o *NetworkRange) GetPrefix() *string { - if o == nil || IsNil(o.Prefix) { - var ret *string - return ret - } - - return o.Prefix +func (o *NetworkRange) GetPrefix() (ret NetworkRangeGetPrefixRetType) { + ret, _ = o.GetPrefixOk() + return ret } // GetPrefixOk returns a tuple with the Prefix field value // and a boolean to check if the value has been set. -func (o *NetworkRange) GetPrefixOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Prefix, true +func (o *NetworkRange) GetPrefixOk() (ret NetworkRangeGetPrefixRetType, ok bool) { + return getNetworkRangeGetPrefixAttributeTypeOk(o.Prefix) } // SetPrefix sets field value -func (o *NetworkRange) SetPrefix(v *string) { - o.Prefix = v +func (o *NetworkRange) SetPrefix(v NetworkRangeGetPrefixRetType) { + setNetworkRangeGetPrefixAttributeType(&o.Prefix, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *NetworkRange) GetUpdatedAt() *time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret *time.Time - return ret - } - return o.UpdatedAt +func (o *NetworkRange) GetUpdatedAt() (res NetworkRangeGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NetworkRange) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true +func (o *NetworkRange) GetUpdatedAtOk() (ret NetworkRangeGetUpdatedAtRetType, ok bool) { + return getNetworkRangeGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. func (o *NetworkRange) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false + _, ok := o.GetUpdatedAtOk() + return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *NetworkRange) SetUpdatedAt(v *time.Time) { - o.UpdatedAt = v +func (o *NetworkRange) SetUpdatedAt(v NetworkRangeGetUpdatedAtRetType) { + setNetworkRangeGetUpdatedAtAttributeType(&o.UpdatedAt, v) } func (o NetworkRange) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt + if val, ok := getNetworkRangeGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getNetworkRangeGetNetworkRangeIdAttributeTypeOk(o.NetworkRangeId); ok { + toSerialize["NetworkRangeId"] = val } - if !IsNil(o.NetworkRangeId) { - toSerialize["networkRangeId"] = o.NetworkRangeId + if val, ok := getNetworkRangeGetPrefixAttributeTypeOk(o.Prefix); ok { + toSerialize["Prefix"] = val } - toSerialize["prefix"] = o.Prefix - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt + if val, ok := getNetworkRangeGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val } return toSerialize, nil } diff --git a/services/iaas/model_network_range_list_response.go b/services/iaas/model_network_range_list_response.go index 84b5f7555..6504baa9f 100644 --- a/services/iaas/model_network_range_list_response.go +++ b/services/iaas/model_network_range_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the NetworkRangeListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &NetworkRangeListResponse{} +/* + types and functions for items +*/ + +// isArray +type NetworkRangeListResponseGetItemsAttributeType = *[]NetworkRange +type NetworkRangeListResponseGetItemsArgType = []NetworkRange +type NetworkRangeListResponseGetItemsRetType = []NetworkRange + +func getNetworkRangeListResponseGetItemsAttributeTypeOk(arg NetworkRangeListResponseGetItemsAttributeType) (ret NetworkRangeListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkRangeListResponseGetItemsAttributeType(arg *NetworkRangeListResponseGetItemsAttributeType, val NetworkRangeListResponseGetItemsRetType) { + *arg = &val +} + // NetworkRangeListResponse Network Range list response. type NetworkRangeListResponse struct { // A list of network ranges. // REQUIRED - Items *[]NetworkRange `json:"items"` + Items NetworkRangeListResponseGetItemsAttributeType `json:"items"` } type _NetworkRangeListResponse NetworkRangeListResponse @@ -30,9 +50,9 @@ type _NetworkRangeListResponse NetworkRangeListResponse // 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 NewNetworkRangeListResponse(items *[]NetworkRange) *NetworkRangeListResponse { +func NewNetworkRangeListResponse(items NetworkRangeListResponseGetItemsArgType) *NetworkRangeListResponse { this := NetworkRangeListResponse{} - this.Items = items + setNetworkRangeListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewNetworkRangeListResponseWithDefaults() *NetworkRangeListResponse { } // GetItems returns the Items field value -func (o *NetworkRangeListResponse) GetItems() *[]NetworkRange { - if o == nil || IsNil(o.Items) { - var ret *[]NetworkRange - return ret - } - - return o.Items +func (o *NetworkRangeListResponse) GetItems() (ret NetworkRangeListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *NetworkRangeListResponse) GetItemsOk() (*[]NetworkRange, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *NetworkRangeListResponse) GetItemsOk() (ret NetworkRangeListResponseGetItemsRetType, ok bool) { + return getNetworkRangeListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *NetworkRangeListResponse) SetItems(v *[]NetworkRange) { - o.Items = v +func (o *NetworkRangeListResponse) SetItems(v NetworkRangeListResponseGetItemsRetType) { + setNetworkRangeListResponseGetItemsAttributeType(&o.Items, v) } func (o NetworkRangeListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getNetworkRangeListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_nic.go b/services/iaas/model_nic.go index ecff3921c..2b64aa2c6 100644 --- a/services/iaas/model_nic.go +++ b/services/iaas/model_nic.go @@ -17,32 +17,301 @@ import ( // checks if the NIC type satisfies the MappedNullable interface at compile time var _ MappedNullable = &NIC{} +/* + types and functions for allowedAddresses +*/ + +// isArray +type NICGetAllowedAddressesAttributeType = *[]AllowedAddressesInner +type NICGetAllowedAddressesArgType = []AllowedAddressesInner +type NICGetAllowedAddressesRetType = []AllowedAddressesInner + +func getNICGetAllowedAddressesAttributeTypeOk(arg NICGetAllowedAddressesAttributeType) (ret NICGetAllowedAddressesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNICGetAllowedAddressesAttributeType(arg *NICGetAllowedAddressesAttributeType, val NICGetAllowedAddressesRetType) { + *arg = &val +} + +/* + types and functions for device +*/ + +// isNotNullableString +type NICGetDeviceAttributeType = *string + +func getNICGetDeviceAttributeTypeOk(arg NICGetDeviceAttributeType) (ret NICGetDeviceRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNICGetDeviceAttributeType(arg *NICGetDeviceAttributeType, val NICGetDeviceRetType) { + *arg = &val +} + +type NICGetDeviceArgType = string +type NICGetDeviceRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type NICGetIdAttributeType = *string + +func getNICGetIdAttributeTypeOk(arg NICGetIdAttributeType) (ret NICGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNICGetIdAttributeType(arg *NICGetIdAttributeType, val NICGetIdRetType) { + *arg = &val +} + +type NICGetIdArgType = string +type NICGetIdRetType = string + +/* + types and functions for ipv4 +*/ + +// isNotNullableString +type NICGetIpv4AttributeType = *string + +func getNICGetIpv4AttributeTypeOk(arg NICGetIpv4AttributeType) (ret NICGetIpv4RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNICGetIpv4AttributeType(arg *NICGetIpv4AttributeType, val NICGetIpv4RetType) { + *arg = &val +} + +type NICGetIpv4ArgType = string +type NICGetIpv4RetType = string + +/* + types and functions for ipv6 +*/ + +// isNotNullableString +type NICGetIpv6AttributeType = *string + +func getNICGetIpv6AttributeTypeOk(arg NICGetIpv6AttributeType) (ret NICGetIpv6RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNICGetIpv6AttributeType(arg *NICGetIpv6AttributeType, val NICGetIpv6RetType) { + *arg = &val +} + +type NICGetIpv6ArgType = string +type NICGetIpv6RetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type NICGetLabelsAttributeType = *map[string]interface{} +type NICGetLabelsArgType = map[string]interface{} +type NICGetLabelsRetType = map[string]interface{} + +func getNICGetLabelsAttributeTypeOk(arg NICGetLabelsAttributeType) (ret NICGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNICGetLabelsAttributeType(arg *NICGetLabelsAttributeType, val NICGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for mac +*/ + +// isNotNullableString +type NICGetMacAttributeType = *string + +func getNICGetMacAttributeTypeOk(arg NICGetMacAttributeType) (ret NICGetMacRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNICGetMacAttributeType(arg *NICGetMacAttributeType, val NICGetMacRetType) { + *arg = &val +} + +type NICGetMacArgType = string +type NICGetMacRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type NICGetNameAttributeType = *string + +func getNICGetNameAttributeTypeOk(arg NICGetNameAttributeType) (ret NICGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNICGetNameAttributeType(arg *NICGetNameAttributeType, val NICGetNameRetType) { + *arg = &val +} + +type NICGetNameArgType = string +type NICGetNameRetType = string + +/* + types and functions for networkId +*/ + +// isNotNullableString +type NICGetNetworkIdAttributeType = *string + +func getNICGetNetworkIdAttributeTypeOk(arg NICGetNetworkIdAttributeType) (ret NICGetNetworkIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNICGetNetworkIdAttributeType(arg *NICGetNetworkIdAttributeType, val NICGetNetworkIdRetType) { + *arg = &val +} + +type NICGetNetworkIdArgType = string +type NICGetNetworkIdRetType = string + +/* + types and functions for nicSecurity +*/ + +// isBoolean +type NICgetNicSecurityAttributeType = *bool +type NICgetNicSecurityArgType = bool +type NICgetNicSecurityRetType = bool + +func getNICgetNicSecurityAttributeTypeOk(arg NICgetNicSecurityAttributeType) (ret NICgetNicSecurityRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNICgetNicSecurityAttributeType(arg *NICgetNicSecurityAttributeType, val NICgetNicSecurityRetType) { + *arg = &val +} + +/* + types and functions for securityGroups +*/ + +// isArray +type NICGetSecurityGroupsAttributeType = *[]string +type NICGetSecurityGroupsArgType = []string +type NICGetSecurityGroupsRetType = []string + +func getNICGetSecurityGroupsAttributeTypeOk(arg NICGetSecurityGroupsAttributeType) (ret NICGetSecurityGroupsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNICGetSecurityGroupsAttributeType(arg *NICGetSecurityGroupsAttributeType, val NICGetSecurityGroupsRetType) { + *arg = &val +} + +/* + types and functions for status +*/ + +// isNotNullableString +type NICGetStatusAttributeType = *string + +func getNICGetStatusAttributeTypeOk(arg NICGetStatusAttributeType) (ret NICGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNICGetStatusAttributeType(arg *NICGetStatusAttributeType, val NICGetStatusRetType) { + *arg = &val +} + +type NICGetStatusArgType = string +type NICGetStatusRetType = string + +/* + types and functions for type +*/ + +// isNotNullableString +type NICGetTypeAttributeType = *string + +func getNICGetTypeAttributeTypeOk(arg NICGetTypeAttributeType) (ret NICGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNICGetTypeAttributeType(arg *NICGetTypeAttributeType, val NICGetTypeRetType) { + *arg = &val +} + +type NICGetTypeArgType = string +type NICGetTypeRetType = string + // NIC Object that represents a network interface. type NIC struct { // A list of IPs or CIDR notations. - AllowedAddresses *[]AllowedAddressesInner `json:"allowedAddresses,omitempty"` + AllowedAddresses NICGetAllowedAddressesAttributeType `json:"allowedAddresses,omitempty"` // Universally Unique Identifier (UUID). - Device *string `json:"device,omitempty"` + Device NICGetDeviceAttributeType `json:"device,omitempty"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id NICGetIdAttributeType `json:"id,omitempty"` // Object that represents an IP address. - Ipv4 *string `json:"ipv4,omitempty"` + Ipv4 NICGetIpv4AttributeType `json:"ipv4,omitempty"` // Object that represents an IPv6 address. - Ipv6 *string `json:"ipv6,omitempty"` + Ipv6 NICGetIpv6AttributeType `json:"ipv6,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels NICGetLabelsAttributeType `json:"labels,omitempty"` // Object that represents an MAC address. - Mac *string `json:"mac,omitempty"` + Mac NICGetMacAttributeType `json:"mac,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty"` + Name NICGetNameAttributeType `json:"name,omitempty"` // Universally Unique Identifier (UUID). - NetworkId *string `json:"networkId,omitempty"` + NetworkId NICGetNetworkIdAttributeType `json:"networkId,omitempty"` // If this is set to false, then no security groups will apply to this network interface. - NicSecurity *bool `json:"nicSecurity,omitempty"` + NicSecurity NICgetNicSecurityAttributeType `json:"nicSecurity,omitempty"` // A list of UUIDs. - SecurityGroups *[]string `json:"securityGroups,omitempty"` - Status *string `json:"status,omitempty"` - Type *string `json:"type,omitempty"` + SecurityGroups NICGetSecurityGroupsAttributeType `json:"securityGroups,omitempty"` + Status NICGetStatusAttributeType `json:"status,omitempty"` + Type NICGetTypeAttributeType `json:"type,omitempty"` } // NewNIC instantiates a new NIC object @@ -51,8 +320,6 @@ type NIC struct { // will change when the set of required properties is changed func NewNIC() *NIC { this := NIC{} - var nicSecurity bool = true - this.NicSecurity = &nicSecurity return &this } @@ -67,461 +334,344 @@ func NewNICWithDefaults() *NIC { } // GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. -func (o *NIC) GetAllowedAddresses() *[]AllowedAddressesInner { - if o == nil || IsNil(o.AllowedAddresses) { - var ret *[]AllowedAddressesInner - return ret - } - return o.AllowedAddresses +func (o *NIC) GetAllowedAddresses() (res NICGetAllowedAddressesRetType) { + res, _ = o.GetAllowedAddressesOk() + return } // GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NIC) GetAllowedAddressesOk() (*[]AllowedAddressesInner, bool) { - if o == nil || IsNil(o.AllowedAddresses) { - return nil, false - } - return o.AllowedAddresses, true +func (o *NIC) GetAllowedAddressesOk() (ret NICGetAllowedAddressesRetType, ok bool) { + return getNICGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses) } // HasAllowedAddresses returns a boolean if a field has been set. func (o *NIC) HasAllowedAddresses() bool { - if o != nil && !IsNil(o.AllowedAddresses) { - return true - } - - return false + _, ok := o.GetAllowedAddressesOk() + return ok } // SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. -func (o *NIC) SetAllowedAddresses(v *[]AllowedAddressesInner) { - o.AllowedAddresses = v +func (o *NIC) SetAllowedAddresses(v NICGetAllowedAddressesRetType) { + setNICGetAllowedAddressesAttributeType(&o.AllowedAddresses, v) } // GetDevice returns the Device field value if set, zero value otherwise. -func (o *NIC) GetDevice() *string { - if o == nil || IsNil(o.Device) { - var ret *string - return ret - } - return o.Device +func (o *NIC) GetDevice() (res NICGetDeviceRetType) { + res, _ = o.GetDeviceOk() + return } // GetDeviceOk returns a tuple with the Device field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NIC) GetDeviceOk() (*string, bool) { - if o == nil || IsNil(o.Device) { - return nil, false - } - return o.Device, true +func (o *NIC) GetDeviceOk() (ret NICGetDeviceRetType, ok bool) { + return getNICGetDeviceAttributeTypeOk(o.Device) } // HasDevice returns a boolean if a field has been set. func (o *NIC) HasDevice() bool { - if o != nil && !IsNil(o.Device) { - return true - } - - return false + _, ok := o.GetDeviceOk() + return ok } // SetDevice gets a reference to the given string and assigns it to the Device field. -func (o *NIC) SetDevice(v *string) { - o.Device = v +func (o *NIC) SetDevice(v NICGetDeviceRetType) { + setNICGetDeviceAttributeType(&o.Device, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *NIC) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *NIC) GetId() (res NICGetIdRetType) { + 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 *NIC) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *NIC) GetIdOk() (ret NICGetIdRetType, ok bool) { + return getNICGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *NIC) 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 *NIC) SetId(v *string) { - o.Id = v +func (o *NIC) SetId(v NICGetIdRetType) { + setNICGetIdAttributeType(&o.Id, v) } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *NIC) GetIpv4() *string { - if o == nil || IsNil(o.Ipv4) { - var ret *string - return ret - } - return o.Ipv4 +func (o *NIC) GetIpv4() (res NICGetIpv4RetType) { + res, _ = o.GetIpv4Ok() + return } // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NIC) GetIpv4Ok() (*string, bool) { - if o == nil || IsNil(o.Ipv4) { - return nil, false - } - return o.Ipv4, true +func (o *NIC) GetIpv4Ok() (ret NICGetIpv4RetType, ok bool) { + return getNICGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. func (o *NIC) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { - return true - } - - return false + _, ok := o.GetIpv4Ok() + return ok } // SetIpv4 gets a reference to the given string and assigns it to the Ipv4 field. -func (o *NIC) SetIpv4(v *string) { - o.Ipv4 = v +func (o *NIC) SetIpv4(v NICGetIpv4RetType) { + setNICGetIpv4AttributeType(&o.Ipv4, v) } // GetIpv6 returns the Ipv6 field value if set, zero value otherwise. -func (o *NIC) GetIpv6() *string { - if o == nil || IsNil(o.Ipv6) { - var ret *string - return ret - } - return o.Ipv6 +func (o *NIC) GetIpv6() (res NICGetIpv6RetType) { + res, _ = o.GetIpv6Ok() + return } // GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NIC) GetIpv6Ok() (*string, bool) { - if o == nil || IsNil(o.Ipv6) { - return nil, false - } - return o.Ipv6, true +func (o *NIC) GetIpv6Ok() (ret NICGetIpv6RetType, ok bool) { + return getNICGetIpv6AttributeTypeOk(o.Ipv6) } // HasIpv6 returns a boolean if a field has been set. func (o *NIC) HasIpv6() bool { - if o != nil && !IsNil(o.Ipv6) { - return true - } - - return false + _, ok := o.GetIpv6Ok() + return ok } // SetIpv6 gets a reference to the given string and assigns it to the Ipv6 field. -func (o *NIC) SetIpv6(v *string) { - o.Ipv6 = v +func (o *NIC) SetIpv6(v NICGetIpv6RetType) { + setNICGetIpv6AttributeType(&o.Ipv6, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *NIC) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *NIC) GetLabels() (res NICGetLabelsRetType) { + 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 *NIC) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *NIC) GetLabelsOk() (ret NICGetLabelsRetType, ok bool) { + return getNICGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *NIC) 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 *NIC) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *NIC) SetLabels(v NICGetLabelsRetType) { + setNICGetLabelsAttributeType(&o.Labels, v) } // GetMac returns the Mac field value if set, zero value otherwise. -func (o *NIC) GetMac() *string { - if o == nil || IsNil(o.Mac) { - var ret *string - return ret - } - return o.Mac +func (o *NIC) GetMac() (res NICGetMacRetType) { + res, _ = o.GetMacOk() + return } // GetMacOk returns a tuple with the Mac field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NIC) GetMacOk() (*string, bool) { - if o == nil || IsNil(o.Mac) { - return nil, false - } - return o.Mac, true +func (o *NIC) GetMacOk() (ret NICGetMacRetType, ok bool) { + return getNICGetMacAttributeTypeOk(o.Mac) } // HasMac returns a boolean if a field has been set. func (o *NIC) HasMac() bool { - if o != nil && !IsNil(o.Mac) { - return true - } - - return false + _, ok := o.GetMacOk() + return ok } // SetMac gets a reference to the given string and assigns it to the Mac field. -func (o *NIC) SetMac(v *string) { - o.Mac = v +func (o *NIC) SetMac(v NICGetMacRetType) { + setNICGetMacAttributeType(&o.Mac, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *NIC) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *NIC) GetName() (res NICGetNameRetType) { + 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 *NIC) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *NIC) GetNameOk() (ret NICGetNameRetType, ok bool) { + return getNICGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *NIC) 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 *NIC) SetName(v *string) { - o.Name = v +func (o *NIC) SetName(v NICGetNameRetType) { + setNICGetNameAttributeType(&o.Name, v) } // GetNetworkId returns the NetworkId field value if set, zero value otherwise. -func (o *NIC) GetNetworkId() *string { - if o == nil || IsNil(o.NetworkId) { - var ret *string - return ret - } - return o.NetworkId +func (o *NIC) GetNetworkId() (res NICGetNetworkIdRetType) { + res, _ = o.GetNetworkIdOk() + return } // GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NIC) GetNetworkIdOk() (*string, bool) { - if o == nil || IsNil(o.NetworkId) { - return nil, false - } - return o.NetworkId, true +func (o *NIC) GetNetworkIdOk() (ret NICGetNetworkIdRetType, ok bool) { + return getNICGetNetworkIdAttributeTypeOk(o.NetworkId) } // HasNetworkId returns a boolean if a field has been set. func (o *NIC) HasNetworkId() bool { - if o != nil && !IsNil(o.NetworkId) { - return true - } - - return false + _, ok := o.GetNetworkIdOk() + return ok } // SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. -func (o *NIC) SetNetworkId(v *string) { - o.NetworkId = v +func (o *NIC) SetNetworkId(v NICGetNetworkIdRetType) { + setNICGetNetworkIdAttributeType(&o.NetworkId, v) } // GetNicSecurity returns the NicSecurity field value if set, zero value otherwise. -func (o *NIC) GetNicSecurity() *bool { - if o == nil || IsNil(o.NicSecurity) { - var ret *bool - return ret - } - return o.NicSecurity +func (o *NIC) GetNicSecurity() (res NICgetNicSecurityRetType) { + res, _ = o.GetNicSecurityOk() + return } // GetNicSecurityOk returns a tuple with the NicSecurity field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NIC) GetNicSecurityOk() (*bool, bool) { - if o == nil || IsNil(o.NicSecurity) { - return nil, false - } - return o.NicSecurity, true +func (o *NIC) GetNicSecurityOk() (ret NICgetNicSecurityRetType, ok bool) { + return getNICgetNicSecurityAttributeTypeOk(o.NicSecurity) } // HasNicSecurity returns a boolean if a field has been set. func (o *NIC) HasNicSecurity() bool { - if o != nil && !IsNil(o.NicSecurity) { - return true - } - - return false + _, ok := o.GetNicSecurityOk() + return ok } // SetNicSecurity gets a reference to the given bool and assigns it to the NicSecurity field. -func (o *NIC) SetNicSecurity(v *bool) { - o.NicSecurity = v +func (o *NIC) SetNicSecurity(v NICgetNicSecurityRetType) { + setNICgetNicSecurityAttributeType(&o.NicSecurity, v) } // GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. -func (o *NIC) GetSecurityGroups() *[]string { - if o == nil || IsNil(o.SecurityGroups) { - var ret *[]string - return ret - } - return o.SecurityGroups +func (o *NIC) GetSecurityGroups() (res NICGetSecurityGroupsRetType) { + res, _ = o.GetSecurityGroupsOk() + return } // GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NIC) GetSecurityGroupsOk() (*[]string, bool) { - if o == nil || IsNil(o.SecurityGroups) { - return nil, false - } - return o.SecurityGroups, true +func (o *NIC) GetSecurityGroupsOk() (ret NICGetSecurityGroupsRetType, ok bool) { + return getNICGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) } // HasSecurityGroups returns a boolean if a field has been set. func (o *NIC) HasSecurityGroups() bool { - if o != nil && !IsNil(o.SecurityGroups) { - return true - } - - return false + _, ok := o.GetSecurityGroupsOk() + return ok } // SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. -func (o *NIC) SetSecurityGroups(v *[]string) { - o.SecurityGroups = v +func (o *NIC) SetSecurityGroups(v NICGetSecurityGroupsRetType) { + setNICGetSecurityGroupsAttributeType(&o.SecurityGroups, v) } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *NIC) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - return o.Status +func (o *NIC) GetStatus() (res NICGetStatusRetType) { + 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 *NIC) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true +func (o *NIC) GetStatusOk() (ret NICGetStatusRetType, ok bool) { + return getNICGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. func (o *NIC) 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 *NIC) SetStatus(v *string) { - o.Status = v +func (o *NIC) SetStatus(v NICGetStatusRetType) { + setNICGetStatusAttributeType(&o.Status, v) } // GetType returns the Type field value if set, zero value otherwise. -func (o *NIC) GetType() *string { - if o == nil || IsNil(o.Type) { - var ret *string - return ret - } - return o.Type +func (o *NIC) GetType() (res NICGetTypeRetType) { + 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 *NIC) GetTypeOk() (*string, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return o.Type, true +func (o *NIC) GetTypeOk() (ret NICGetTypeRetType, ok bool) { + return getNICGetTypeAttributeTypeOk(o.Type) } // HasType returns a boolean if a field has been set. func (o *NIC) HasType() bool { - if o != nil && !IsNil(o.Type) { - return true - } - - return false + _, ok := o.GetTypeOk() + return ok } // SetType gets a reference to the given string and assigns it to the Type field. -func (o *NIC) SetType(v *string) { - o.Type = v +func (o *NIC) SetType(v NICGetTypeRetType) { + setNICGetTypeAttributeType(&o.Type, v) } func (o NIC) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.AllowedAddresses) { - toSerialize["allowedAddresses"] = o.AllowedAddresses + if val, ok := getNICGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses); ok { + toSerialize["AllowedAddresses"] = val } - if !IsNil(o.Device) { - toSerialize["device"] = o.Device + if val, ok := getNICGetDeviceAttributeTypeOk(o.Device); ok { + toSerialize["Device"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getNICGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Ipv4) { - toSerialize["ipv4"] = o.Ipv4 + if val, ok := getNICGetIpv4AttributeTypeOk(o.Ipv4); ok { + toSerialize["Ipv4"] = val } - if !IsNil(o.Ipv6) { - toSerialize["ipv6"] = o.Ipv6 + if val, ok := getNICGetIpv6AttributeTypeOk(o.Ipv6); ok { + toSerialize["Ipv6"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getNICGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Mac) { - toSerialize["mac"] = o.Mac + if val, ok := getNICGetMacAttributeTypeOk(o.Mac); ok { + toSerialize["Mac"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getNICGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.NetworkId) { - toSerialize["networkId"] = o.NetworkId + if val, ok := getNICGetNetworkIdAttributeTypeOk(o.NetworkId); ok { + toSerialize["NetworkId"] = val } - if !IsNil(o.NicSecurity) { - toSerialize["nicSecurity"] = o.NicSecurity + if val, ok := getNICgetNicSecurityAttributeTypeOk(o.NicSecurity); ok { + toSerialize["NicSecurity"] = val } - if !IsNil(o.SecurityGroups) { - toSerialize["securityGroups"] = o.SecurityGroups + if val, ok := getNICGetSecurityGroupsAttributeTypeOk(o.SecurityGroups); ok { + toSerialize["SecurityGroups"] = val } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status + if val, ok := getNICGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } - if !IsNil(o.Type) { - toSerialize["type"] = o.Type + if val, ok := getNICGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val } return toSerialize, nil } diff --git a/services/iaas/model_nic_list_response.go b/services/iaas/model_nic_list_response.go index 779c0d4ed..28e734428 100644 --- a/services/iaas/model_nic_list_response.go +++ b/services/iaas/model_nic_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the NICListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &NICListResponse{} +/* + types and functions for items +*/ + +// isArray +type NICListResponseGetItemsAttributeType = *[]NIC +type NICListResponseGetItemsArgType = []NIC +type NICListResponseGetItemsRetType = []NIC + +func getNICListResponseGetItemsAttributeTypeOk(arg NICListResponseGetItemsAttributeType) (ret NICListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNICListResponseGetItemsAttributeType(arg *NICListResponseGetItemsAttributeType, val NICListResponseGetItemsRetType) { + *arg = &val +} + // NICListResponse NIC list response. type NICListResponse struct { // A list of network interfaces. // REQUIRED - Items *[]NIC `json:"items"` + Items NICListResponseGetItemsAttributeType `json:"items"` } type _NICListResponse NICListResponse @@ -30,9 +50,9 @@ type _NICListResponse NICListResponse // 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 NewNICListResponse(items *[]NIC) *NICListResponse { +func NewNICListResponse(items NICListResponseGetItemsArgType) *NICListResponse { this := NICListResponse{} - this.Items = items + setNICListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewNICListResponseWithDefaults() *NICListResponse { } // GetItems returns the Items field value -func (o *NICListResponse) GetItems() *[]NIC { - if o == nil || IsNil(o.Items) { - var ret *[]NIC - return ret - } - - return o.Items +func (o *NICListResponse) GetItems() (ret NICListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *NICListResponse) GetItemsOk() (*[]NIC, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *NICListResponse) GetItemsOk() (ret NICListResponseGetItemsRetType, ok bool) { + return getNICListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *NICListResponse) SetItems(v *[]NIC) { - o.Items = v +func (o *NICListResponse) SetItems(v NICListResponseGetItemsRetType) { + setNICListResponseGetItemsAttributeType(&o.Items, v) } func (o NICListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getNICListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_partial_update_network_area_payload.go b/services/iaas/model_partial_update_network_area_payload.go index f3e8781ce..9dcfc3e31 100644 --- a/services/iaas/model_partial_update_network_area_payload.go +++ b/services/iaas/model_partial_update_network_area_payload.go @@ -17,13 +17,74 @@ import ( // checks if the PartialUpdateNetworkAreaPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &PartialUpdateNetworkAreaPayload{} +/* + types and functions for addressFamily +*/ + +// isModel +type PartialUpdateNetworkAreaPayloadGetAddressFamilyAttributeType = *UpdateAreaAddressFamily +type PartialUpdateNetworkAreaPayloadGetAddressFamilyArgType = UpdateAreaAddressFamily +type PartialUpdateNetworkAreaPayloadGetAddressFamilyRetType = UpdateAreaAddressFamily + +func getPartialUpdateNetworkAreaPayloadGetAddressFamilyAttributeTypeOk(arg PartialUpdateNetworkAreaPayloadGetAddressFamilyAttributeType) (ret PartialUpdateNetworkAreaPayloadGetAddressFamilyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateNetworkAreaPayloadGetAddressFamilyAttributeType(arg *PartialUpdateNetworkAreaPayloadGetAddressFamilyAttributeType, val PartialUpdateNetworkAreaPayloadGetAddressFamilyRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isFreeform +type PartialUpdateNetworkAreaPayloadGetLabelsAttributeType = *map[string]interface{} +type PartialUpdateNetworkAreaPayloadGetLabelsArgType = map[string]interface{} +type PartialUpdateNetworkAreaPayloadGetLabelsRetType = map[string]interface{} + +func getPartialUpdateNetworkAreaPayloadGetLabelsAttributeTypeOk(arg PartialUpdateNetworkAreaPayloadGetLabelsAttributeType) (ret PartialUpdateNetworkAreaPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateNetworkAreaPayloadGetLabelsAttributeType(arg *PartialUpdateNetworkAreaPayloadGetLabelsAttributeType, val PartialUpdateNetworkAreaPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type PartialUpdateNetworkAreaPayloadGetNameAttributeType = *string + +func getPartialUpdateNetworkAreaPayloadGetNameAttributeTypeOk(arg PartialUpdateNetworkAreaPayloadGetNameAttributeType) (ret PartialUpdateNetworkAreaPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateNetworkAreaPayloadGetNameAttributeType(arg *PartialUpdateNetworkAreaPayloadGetNameAttributeType, val PartialUpdateNetworkAreaPayloadGetNameRetType) { + *arg = &val +} + +type PartialUpdateNetworkAreaPayloadGetNameArgType = string +type PartialUpdateNetworkAreaPayloadGetNameRetType = string + // PartialUpdateNetworkAreaPayload struct for PartialUpdateNetworkAreaPayload type PartialUpdateNetworkAreaPayload struct { - AddressFamily *UpdateAreaAddressFamily `json:"addressFamily,omitempty"` + AddressFamily PartialUpdateNetworkAreaPayloadGetAddressFamilyAttributeType `json:"addressFamily,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels PartialUpdateNetworkAreaPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty"` + Name PartialUpdateNetworkAreaPayloadGetNameAttributeType `json:"name,omitempty"` } // NewPartialUpdateNetworkAreaPayload instantiates a new PartialUpdateNetworkAreaPayload object @@ -44,111 +105,84 @@ func NewPartialUpdateNetworkAreaPayloadWithDefaults() *PartialUpdateNetworkAreaP } // GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. -func (o *PartialUpdateNetworkAreaPayload) GetAddressFamily() *UpdateAreaAddressFamily { - if o == nil || IsNil(o.AddressFamily) { - var ret *UpdateAreaAddressFamily - return ret - } - return o.AddressFamily +func (o *PartialUpdateNetworkAreaPayload) GetAddressFamily() (res PartialUpdateNetworkAreaPayloadGetAddressFamilyRetType) { + res, _ = o.GetAddressFamilyOk() + return } // GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PartialUpdateNetworkAreaPayload) GetAddressFamilyOk() (*UpdateAreaAddressFamily, bool) { - if o == nil || IsNil(o.AddressFamily) { - return nil, false - } - return o.AddressFamily, true +func (o *PartialUpdateNetworkAreaPayload) GetAddressFamilyOk() (ret PartialUpdateNetworkAreaPayloadGetAddressFamilyRetType, ok bool) { + return getPartialUpdateNetworkAreaPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily) } // HasAddressFamily returns a boolean if a field has been set. func (o *PartialUpdateNetworkAreaPayload) HasAddressFamily() bool { - if o != nil && !IsNil(o.AddressFamily) { - return true - } - - return false + _, ok := o.GetAddressFamilyOk() + return ok } // SetAddressFamily gets a reference to the given UpdateAreaAddressFamily and assigns it to the AddressFamily field. -func (o *PartialUpdateNetworkAreaPayload) SetAddressFamily(v *UpdateAreaAddressFamily) { - o.AddressFamily = v +func (o *PartialUpdateNetworkAreaPayload) SetAddressFamily(v PartialUpdateNetworkAreaPayloadGetAddressFamilyRetType) { + setPartialUpdateNetworkAreaPayloadGetAddressFamilyAttributeType(&o.AddressFamily, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *PartialUpdateNetworkAreaPayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *PartialUpdateNetworkAreaPayload) GetLabels() (res PartialUpdateNetworkAreaPayloadGetLabelsRetType) { + 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 *PartialUpdateNetworkAreaPayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *PartialUpdateNetworkAreaPayload) GetLabelsOk() (ret PartialUpdateNetworkAreaPayloadGetLabelsRetType, ok bool) { + return getPartialUpdateNetworkAreaPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *PartialUpdateNetworkAreaPayload) 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 *PartialUpdateNetworkAreaPayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *PartialUpdateNetworkAreaPayload) SetLabels(v PartialUpdateNetworkAreaPayloadGetLabelsRetType) { + setPartialUpdateNetworkAreaPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *PartialUpdateNetworkAreaPayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *PartialUpdateNetworkAreaPayload) GetName() (res PartialUpdateNetworkAreaPayloadGetNameRetType) { + 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 *PartialUpdateNetworkAreaPayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *PartialUpdateNetworkAreaPayload) GetNameOk() (ret PartialUpdateNetworkAreaPayloadGetNameRetType, ok bool) { + return getPartialUpdateNetworkAreaPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *PartialUpdateNetworkAreaPayload) 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 *PartialUpdateNetworkAreaPayload) SetName(v *string) { - o.Name = v +func (o *PartialUpdateNetworkAreaPayload) SetName(v PartialUpdateNetworkAreaPayloadGetNameRetType) { + setPartialUpdateNetworkAreaPayloadGetNameAttributeType(&o.Name, v) } func (o PartialUpdateNetworkAreaPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.AddressFamily) { - toSerialize["addressFamily"] = o.AddressFamily + if val, ok := getPartialUpdateNetworkAreaPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily); ok { + toSerialize["AddressFamily"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getPartialUpdateNetworkAreaPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getPartialUpdateNetworkAreaPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } return toSerialize, nil } diff --git a/services/iaas/model_partial_update_network_payload.go b/services/iaas/model_partial_update_network_payload.go index 43fe96d49..6ee79d719 100644 --- a/services/iaas/model_partial_update_network_payload.go +++ b/services/iaas/model_partial_update_network_payload.go @@ -17,15 +17,96 @@ import ( // checks if the PartialUpdateNetworkPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &PartialUpdateNetworkPayload{} +/* + types and functions for addressFamily +*/ + +// isModel +type PartialUpdateNetworkPayloadGetAddressFamilyAttributeType = *UpdateNetworkAddressFamily +type PartialUpdateNetworkPayloadGetAddressFamilyArgType = UpdateNetworkAddressFamily +type PartialUpdateNetworkPayloadGetAddressFamilyRetType = UpdateNetworkAddressFamily + +func getPartialUpdateNetworkPayloadGetAddressFamilyAttributeTypeOk(arg PartialUpdateNetworkPayloadGetAddressFamilyAttributeType) (ret PartialUpdateNetworkPayloadGetAddressFamilyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateNetworkPayloadGetAddressFamilyAttributeType(arg *PartialUpdateNetworkPayloadGetAddressFamilyAttributeType, val PartialUpdateNetworkPayloadGetAddressFamilyRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isFreeform +type PartialUpdateNetworkPayloadGetLabelsAttributeType = *map[string]interface{} +type PartialUpdateNetworkPayloadGetLabelsArgType = map[string]interface{} +type PartialUpdateNetworkPayloadGetLabelsRetType = map[string]interface{} + +func getPartialUpdateNetworkPayloadGetLabelsAttributeTypeOk(arg PartialUpdateNetworkPayloadGetLabelsAttributeType) (ret PartialUpdateNetworkPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateNetworkPayloadGetLabelsAttributeType(arg *PartialUpdateNetworkPayloadGetLabelsAttributeType, val PartialUpdateNetworkPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type PartialUpdateNetworkPayloadGetNameAttributeType = *string + +func getPartialUpdateNetworkPayloadGetNameAttributeTypeOk(arg PartialUpdateNetworkPayloadGetNameAttributeType) (ret PartialUpdateNetworkPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateNetworkPayloadGetNameAttributeType(arg *PartialUpdateNetworkPayloadGetNameAttributeType, val PartialUpdateNetworkPayloadGetNameRetType) { + *arg = &val +} + +type PartialUpdateNetworkPayloadGetNameArgType = string +type PartialUpdateNetworkPayloadGetNameRetType = string + +/* + types and functions for routed +*/ + +// isBoolean +type PartialUpdateNetworkPayloadgetRoutedAttributeType = *bool +type PartialUpdateNetworkPayloadgetRoutedArgType = bool +type PartialUpdateNetworkPayloadgetRoutedRetType = bool + +func getPartialUpdateNetworkPayloadgetRoutedAttributeTypeOk(arg PartialUpdateNetworkPayloadgetRoutedAttributeType) (ret PartialUpdateNetworkPayloadgetRoutedRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateNetworkPayloadgetRoutedAttributeType(arg *PartialUpdateNetworkPayloadgetRoutedAttributeType, val PartialUpdateNetworkPayloadgetRoutedRetType) { + *arg = &val +} + // PartialUpdateNetworkPayload Object that represents the request body for a network update. type PartialUpdateNetworkPayload struct { - AddressFamily *UpdateNetworkAddressFamily `json:"addressFamily,omitempty"` + AddressFamily PartialUpdateNetworkPayloadGetAddressFamilyAttributeType `json:"addressFamily,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels PartialUpdateNetworkPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty"` + Name PartialUpdateNetworkPayloadGetNameAttributeType `json:"name,omitempty"` // Shows if the network is routed and therefore accessible from other networks. - Routed *bool `json:"routed,omitempty"` + Routed PartialUpdateNetworkPayloadgetRoutedAttributeType `json:"routed,omitempty"` } // NewPartialUpdateNetworkPayload instantiates a new PartialUpdateNetworkPayload object @@ -46,146 +127,110 @@ func NewPartialUpdateNetworkPayloadWithDefaults() *PartialUpdateNetworkPayload { } // GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. -func (o *PartialUpdateNetworkPayload) GetAddressFamily() *UpdateNetworkAddressFamily { - if o == nil || IsNil(o.AddressFamily) { - var ret *UpdateNetworkAddressFamily - return ret - } - return o.AddressFamily +func (o *PartialUpdateNetworkPayload) GetAddressFamily() (res PartialUpdateNetworkPayloadGetAddressFamilyRetType) { + res, _ = o.GetAddressFamilyOk() + return } // GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PartialUpdateNetworkPayload) GetAddressFamilyOk() (*UpdateNetworkAddressFamily, bool) { - if o == nil || IsNil(o.AddressFamily) { - return nil, false - } - return o.AddressFamily, true +func (o *PartialUpdateNetworkPayload) GetAddressFamilyOk() (ret PartialUpdateNetworkPayloadGetAddressFamilyRetType, ok bool) { + return getPartialUpdateNetworkPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily) } // HasAddressFamily returns a boolean if a field has been set. func (o *PartialUpdateNetworkPayload) HasAddressFamily() bool { - if o != nil && !IsNil(o.AddressFamily) { - return true - } - - return false + _, ok := o.GetAddressFamilyOk() + return ok } // SetAddressFamily gets a reference to the given UpdateNetworkAddressFamily and assigns it to the AddressFamily field. -func (o *PartialUpdateNetworkPayload) SetAddressFamily(v *UpdateNetworkAddressFamily) { - o.AddressFamily = v +func (o *PartialUpdateNetworkPayload) SetAddressFamily(v PartialUpdateNetworkPayloadGetAddressFamilyRetType) { + setPartialUpdateNetworkPayloadGetAddressFamilyAttributeType(&o.AddressFamily, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *PartialUpdateNetworkPayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *PartialUpdateNetworkPayload) GetLabels() (res PartialUpdateNetworkPayloadGetLabelsRetType) { + 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 *PartialUpdateNetworkPayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *PartialUpdateNetworkPayload) GetLabelsOk() (ret PartialUpdateNetworkPayloadGetLabelsRetType, ok bool) { + return getPartialUpdateNetworkPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *PartialUpdateNetworkPayload) 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 *PartialUpdateNetworkPayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *PartialUpdateNetworkPayload) SetLabels(v PartialUpdateNetworkPayloadGetLabelsRetType) { + setPartialUpdateNetworkPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *PartialUpdateNetworkPayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *PartialUpdateNetworkPayload) GetName() (res PartialUpdateNetworkPayloadGetNameRetType) { + 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 *PartialUpdateNetworkPayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *PartialUpdateNetworkPayload) GetNameOk() (ret PartialUpdateNetworkPayloadGetNameRetType, ok bool) { + return getPartialUpdateNetworkPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *PartialUpdateNetworkPayload) 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 *PartialUpdateNetworkPayload) SetName(v *string) { - o.Name = v +func (o *PartialUpdateNetworkPayload) SetName(v PartialUpdateNetworkPayloadGetNameRetType) { + setPartialUpdateNetworkPayloadGetNameAttributeType(&o.Name, v) } // GetRouted returns the Routed field value if set, zero value otherwise. -func (o *PartialUpdateNetworkPayload) GetRouted() *bool { - if o == nil || IsNil(o.Routed) { - var ret *bool - return ret - } - return o.Routed +func (o *PartialUpdateNetworkPayload) GetRouted() (res PartialUpdateNetworkPayloadgetRoutedRetType) { + res, _ = o.GetRoutedOk() + return } // GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PartialUpdateNetworkPayload) GetRoutedOk() (*bool, bool) { - if o == nil || IsNil(o.Routed) { - return nil, false - } - return o.Routed, true +func (o *PartialUpdateNetworkPayload) GetRoutedOk() (ret PartialUpdateNetworkPayloadgetRoutedRetType, ok bool) { + return getPartialUpdateNetworkPayloadgetRoutedAttributeTypeOk(o.Routed) } // HasRouted returns a boolean if a field has been set. func (o *PartialUpdateNetworkPayload) HasRouted() bool { - if o != nil && !IsNil(o.Routed) { - return true - } - - return false + _, ok := o.GetRoutedOk() + return ok } // SetRouted gets a reference to the given bool and assigns it to the Routed field. -func (o *PartialUpdateNetworkPayload) SetRouted(v *bool) { - o.Routed = v +func (o *PartialUpdateNetworkPayload) SetRouted(v PartialUpdateNetworkPayloadgetRoutedRetType) { + setPartialUpdateNetworkPayloadgetRoutedAttributeType(&o.Routed, v) } func (o PartialUpdateNetworkPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.AddressFamily) { - toSerialize["addressFamily"] = o.AddressFamily + if val, ok := getPartialUpdateNetworkPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily); ok { + toSerialize["AddressFamily"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getPartialUpdateNetworkPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getPartialUpdateNetworkPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Routed) { - toSerialize["routed"] = o.Routed + if val, ok := getPartialUpdateNetworkPayloadgetRoutedAttributeTypeOk(o.Routed); ok { + toSerialize["Routed"] = val } return toSerialize, nil } diff --git a/services/iaas/model_port_range.go b/services/iaas/model_port_range.go index d652cf5e0..e32e8dd7a 100644 --- a/services/iaas/model_port_range.go +++ b/services/iaas/model_port_range.go @@ -17,14 +17,54 @@ import ( // checks if the PortRange type satisfies the MappedNullable interface at compile time var _ MappedNullable = &PortRange{} +/* + types and functions for max +*/ + +// isLong +type PortRangeGetMaxAttributeType = *int64 +type PortRangeGetMaxArgType = int64 +type PortRangeGetMaxRetType = int64 + +func getPortRangeGetMaxAttributeTypeOk(arg PortRangeGetMaxAttributeType) (ret PortRangeGetMaxRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPortRangeGetMaxAttributeType(arg *PortRangeGetMaxAttributeType, val PortRangeGetMaxRetType) { + *arg = &val +} + +/* + types and functions for min +*/ + +// isLong +type PortRangeGetMinAttributeType = *int64 +type PortRangeGetMinArgType = int64 +type PortRangeGetMinRetType = int64 + +func getPortRangeGetMinAttributeTypeOk(arg PortRangeGetMinAttributeType) (ret PortRangeGetMinRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPortRangeGetMinAttributeType(arg *PortRangeGetMinAttributeType, val PortRangeGetMinRetType) { + *arg = &val +} + // PortRange Object that represents a range of ports. type PortRange struct { // The maximum port number. Should be greater or equal to the minimum. // REQUIRED - Max *int64 `json:"max"` + Max PortRangeGetMaxAttributeType `json:"max"` // The minimum port number. Should be less or equal to the maximum. // REQUIRED - Min *int64 `json:"min"` + Min PortRangeGetMinAttributeType `json:"min"` } type _PortRange PortRange @@ -33,10 +73,10 @@ type _PortRange PortRange // 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 NewPortRange(max *int64, min *int64) *PortRange { +func NewPortRange(max PortRangeGetMaxArgType, min PortRangeGetMinArgType) *PortRange { this := PortRange{} - this.Max = max - this.Min = min + setPortRangeGetMaxAttributeType(&this.Max, max) + setPortRangeGetMinAttributeType(&this.Min, min) return &this } @@ -49,57 +89,47 @@ func NewPortRangeWithDefaults() *PortRange { } // GetMax returns the Max field value -func (o *PortRange) GetMax() *int64 { - if o == nil || IsNil(o.Max) { - var ret *int64 - return ret - } - - return o.Max +func (o *PortRange) GetMax() (ret PortRangeGetMaxRetType) { + ret, _ = o.GetMaxOk() + return ret } // GetMaxOk returns a tuple with the Max field value // and a boolean to check if the value has been set. -func (o *PortRange) GetMaxOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Max, true +func (o *PortRange) GetMaxOk() (ret PortRangeGetMaxRetType, ok bool) { + return getPortRangeGetMaxAttributeTypeOk(o.Max) } // SetMax sets field value -func (o *PortRange) SetMax(v *int64) { - o.Max = v +func (o *PortRange) SetMax(v PortRangeGetMaxRetType) { + setPortRangeGetMaxAttributeType(&o.Max, v) } // GetMin returns the Min field value -func (o *PortRange) GetMin() *int64 { - if o == nil || IsNil(o.Min) { - var ret *int64 - return ret - } - - return o.Min +func (o *PortRange) GetMin() (ret PortRangeGetMinRetType) { + ret, _ = o.GetMinOk() + return ret } // GetMinOk returns a tuple with the Min field value // and a boolean to check if the value has been set. -func (o *PortRange) GetMinOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Min, true +func (o *PortRange) GetMinOk() (ret PortRangeGetMinRetType, ok bool) { + return getPortRangeGetMinAttributeTypeOk(o.Min) } // SetMin sets field value -func (o *PortRange) SetMin(v *int64) { - o.Min = v +func (o *PortRange) SetMin(v PortRangeGetMinRetType) { + setPortRangeGetMinAttributeType(&o.Min, v) } func (o PortRange) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["max"] = o.Max - toSerialize["min"] = o.Min + if val, ok := getPortRangeGetMaxAttributeTypeOk(o.Max); ok { + toSerialize["Max"] = val + } + if val, ok := getPortRangeGetMinAttributeTypeOk(o.Min); ok { + toSerialize["Min"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_project_list_response.go b/services/iaas/model_project_list_response.go index 9de206806..d43beca0e 100644 --- a/services/iaas/model_project_list_response.go +++ b/services/iaas/model_project_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the ProjectListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ProjectListResponse{} +/* + types and functions for items +*/ + +// isArray +type ProjectListResponseGetItemsAttributeType = *[]string +type ProjectListResponseGetItemsArgType = []string +type ProjectListResponseGetItemsRetType = []string + +func getProjectListResponseGetItemsAttributeTypeOk(arg ProjectListResponseGetItemsAttributeType) (ret ProjectListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setProjectListResponseGetItemsAttributeType(arg *ProjectListResponseGetItemsAttributeType, val ProjectListResponseGetItemsRetType) { + *arg = &val +} + // ProjectListResponse Project list response. type ProjectListResponse struct { // A list of STACKIT projects. // REQUIRED - Items *[]string `json:"items"` + Items ProjectListResponseGetItemsAttributeType `json:"items"` } type _ProjectListResponse ProjectListResponse @@ -30,9 +50,9 @@ type _ProjectListResponse ProjectListResponse // 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 NewProjectListResponse(items *[]string) *ProjectListResponse { +func NewProjectListResponse(items ProjectListResponseGetItemsArgType) *ProjectListResponse { this := ProjectListResponse{} - this.Items = items + setProjectListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewProjectListResponseWithDefaults() *ProjectListResponse { } // GetItems returns the Items field value -func (o *ProjectListResponse) GetItems() *[]string { - if o == nil || IsNil(o.Items) { - var ret *[]string - return ret - } - - return o.Items +func (o *ProjectListResponse) GetItems() (ret ProjectListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *ProjectListResponse) GetItemsOk() (*[]string, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *ProjectListResponse) GetItemsOk() (ret ProjectListResponseGetItemsRetType, ok bool) { + return getProjectListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *ProjectListResponse) SetItems(v *[]string) { - o.Items = v +func (o *ProjectListResponse) SetItems(v ProjectListResponseGetItemsRetType) { + setProjectListResponseGetItemsAttributeType(&o.Items, v) } func (o ProjectListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getProjectListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_protocol.go b/services/iaas/model_protocol.go index 19785adf8..74f8a89db 100644 --- a/services/iaas/model_protocol.go +++ b/services/iaas/model_protocol.go @@ -17,12 +17,53 @@ import ( // checks if the Protocol type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Protocol{} +/* + types and functions for name +*/ + +// isNotNullableString +type ProtocolGetNameAttributeType = *string + +func getProtocolGetNameAttributeTypeOk(arg ProtocolGetNameAttributeType) (ret ProtocolGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setProtocolGetNameAttributeType(arg *ProtocolGetNameAttributeType, val ProtocolGetNameRetType) { + *arg = &val +} + +type ProtocolGetNameArgType = string +type ProtocolGetNameRetType = string + +/* + types and functions for number +*/ + +// isLong +type ProtocolGetNumberAttributeType = *int64 +type ProtocolGetNumberArgType = int64 +type ProtocolGetNumberRetType = int64 + +func getProtocolGetNumberAttributeTypeOk(arg ProtocolGetNumberAttributeType) (ret ProtocolGetNumberRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setProtocolGetNumberAttributeType(arg *ProtocolGetNumberAttributeType, val ProtocolGetNumberRetType) { + *arg = &val +} + // Protocol The schema for a protocol of a security group rule. type Protocol struct { // The protocol name which the rule should match. Possible values: `ah`, `dccp`, `egp`, `esp`, `gre`, `icmp`, `igmp`, `ipip`, `ipv6-encap`, `ipv6-frag`, `ipv6-icmp`, `ipv6-nonxt`, `ipv6-opts`, `ipv6-route`, `ospf`, `pgm`, `rsvp`, `sctp`, `tcp`, `udp`, `udplite`, `vrrp`. - Name *string `json:"name,omitempty"` + Name ProtocolGetNameAttributeType `json:"name,omitempty"` // The protocol number which the rule should match. - Number *int64 `json:"number,omitempty"` + Number ProtocolGetNumberAttributeType `json:"number,omitempty"` } // NewProtocol instantiates a new Protocol object @@ -43,76 +84,58 @@ func NewProtocolWithDefaults() *Protocol { } // GetName returns the Name field value if set, zero value otherwise. -func (o *Protocol) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *Protocol) GetName() (res ProtocolGetNameRetType) { + 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 *Protocol) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *Protocol) GetNameOk() (ret ProtocolGetNameRetType, ok bool) { + return getProtocolGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *Protocol) 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 *Protocol) SetName(v *string) { - o.Name = v +func (o *Protocol) SetName(v ProtocolGetNameRetType) { + setProtocolGetNameAttributeType(&o.Name, v) } // GetNumber returns the Number field value if set, zero value otherwise. -func (o *Protocol) GetNumber() *int64 { - if o == nil || IsNil(o.Number) { - var ret *int64 - return ret - } - return o.Number +func (o *Protocol) GetNumber() (res ProtocolGetNumberRetType) { + res, _ = o.GetNumberOk() + return } // GetNumberOk returns a tuple with the Number field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Protocol) GetNumberOk() (*int64, bool) { - if o == nil || IsNil(o.Number) { - return nil, false - } - return o.Number, true +func (o *Protocol) GetNumberOk() (ret ProtocolGetNumberRetType, ok bool) { + return getProtocolGetNumberAttributeTypeOk(o.Number) } // HasNumber returns a boolean if a field has been set. func (o *Protocol) HasNumber() bool { - if o != nil && !IsNil(o.Number) { - return true - } - - return false + _, ok := o.GetNumberOk() + return ok } // SetNumber gets a reference to the given int64 and assigns it to the Number field. -func (o *Protocol) SetNumber(v *int64) { - o.Number = v +func (o *Protocol) SetNumber(v ProtocolGetNumberRetType) { + setProtocolGetNumberAttributeType(&o.Number, v) } func (o Protocol) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getProtocolGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Number) { - toSerialize["number"] = o.Number + if val, ok := getProtocolGetNumberAttributeTypeOk(o.Number); ok { + toSerialize["Number"] = val } return toSerialize, nil } diff --git a/services/iaas/model_public_ip.go b/services/iaas/model_public_ip.go index bf715f0e1..094040ec4 100644 --- a/services/iaas/model_public_ip.go +++ b/services/iaas/model_public_ip.go @@ -17,16 +17,103 @@ import ( // checks if the PublicIp type satisfies the MappedNullable interface at compile time var _ MappedNullable = &PublicIp{} +/* + types and functions for id +*/ + +// isNotNullableString +type PublicIpGetIdAttributeType = *string + +func getPublicIpGetIdAttributeTypeOk(arg PublicIpGetIdAttributeType) (ret PublicIpGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPublicIpGetIdAttributeType(arg *PublicIpGetIdAttributeType, val PublicIpGetIdRetType) { + *arg = &val +} + +type PublicIpGetIdArgType = string +type PublicIpGetIdRetType = string + +/* + types and functions for ip +*/ + +// isNotNullableString +type PublicIpGetIpAttributeType = *string + +func getPublicIpGetIpAttributeTypeOk(arg PublicIpGetIpAttributeType) (ret PublicIpGetIpRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPublicIpGetIpAttributeType(arg *PublicIpGetIpAttributeType, val PublicIpGetIpRetType) { + *arg = &val +} + +type PublicIpGetIpArgType = string +type PublicIpGetIpRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type PublicIpGetLabelsAttributeType = *map[string]interface{} +type PublicIpGetLabelsArgType = map[string]interface{} +type PublicIpGetLabelsRetType = map[string]interface{} + +func getPublicIpGetLabelsAttributeTypeOk(arg PublicIpGetLabelsAttributeType) (ret PublicIpGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPublicIpGetLabelsAttributeType(arg *PublicIpGetLabelsAttributeType, val PublicIpGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for networkInterface +*/ + +// isNullableString +type PublicIpGetNetworkInterfaceAttributeType = *NullableString + +func getPublicIpGetNetworkInterfaceAttributeTypeOk(arg PublicIpGetNetworkInterfaceAttributeType) (ret PublicIpGetNetworkInterfaceRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setPublicIpGetNetworkInterfaceAttributeType(arg *PublicIpGetNetworkInterfaceAttributeType, val PublicIpGetNetworkInterfaceRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type PublicIpGetNetworkInterfaceArgType = *string +type PublicIpGetNetworkInterfaceRetType = *string + // PublicIp Object that represents a public IP. type PublicIp struct { // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id PublicIpGetIdAttributeType `json:"id,omitempty"` // Object that represents an IP address. - Ip *string `json:"ip,omitempty"` + Ip PublicIpGetIpAttributeType `json:"ip,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels PublicIpGetLabelsAttributeType `json:"labels,omitempty"` // Universally Unique Identifier (UUID). - NetworkInterface *NullableString `json:"networkInterface,omitempty"` + NetworkInterface PublicIpGetNetworkInterfaceAttributeType `json:"networkInterface,omitempty"` } // NewPublicIp instantiates a new PublicIp object @@ -47,166 +134,121 @@ func NewPublicIpWithDefaults() *PublicIp { } // GetId returns the Id field value if set, zero value otherwise. -func (o *PublicIp) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *PublicIp) GetId() (res PublicIpGetIdRetType) { + 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 *PublicIp) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *PublicIp) GetIdOk() (ret PublicIpGetIdRetType, ok bool) { + return getPublicIpGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *PublicIp) 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 *PublicIp) SetId(v *string) { - o.Id = v +func (o *PublicIp) SetId(v PublicIpGetIdRetType) { + setPublicIpGetIdAttributeType(&o.Id, v) } // GetIp returns the Ip field value if set, zero value otherwise. -func (o *PublicIp) GetIp() *string { - if o == nil || IsNil(o.Ip) { - var ret *string - return ret - } - return o.Ip +func (o *PublicIp) GetIp() (res PublicIpGetIpRetType) { + res, _ = o.GetIpOk() + return } // GetIpOk returns a tuple with the Ip field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PublicIp) GetIpOk() (*string, bool) { - if o == nil || IsNil(o.Ip) { - return nil, false - } - return o.Ip, true +func (o *PublicIp) GetIpOk() (ret PublicIpGetIpRetType, ok bool) { + return getPublicIpGetIpAttributeTypeOk(o.Ip) } // HasIp returns a boolean if a field has been set. func (o *PublicIp) HasIp() bool { - if o != nil && !IsNil(o.Ip) { - return true - } - - return false + _, ok := o.GetIpOk() + return ok } // SetIp gets a reference to the given string and assigns it to the Ip field. -func (o *PublicIp) SetIp(v *string) { - o.Ip = v +func (o *PublicIp) SetIp(v PublicIpGetIpRetType) { + setPublicIpGetIpAttributeType(&o.Ip, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *PublicIp) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *PublicIp) GetLabels() (res PublicIpGetLabelsRetType) { + 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 *PublicIp) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *PublicIp) GetLabelsOk() (ret PublicIpGetLabelsRetType, ok bool) { + return getPublicIpGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *PublicIp) 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 *PublicIp) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *PublicIp) SetLabels(v PublicIpGetLabelsRetType) { + setPublicIpGetLabelsAttributeType(&o.Labels, v) } // GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *PublicIp) GetNetworkInterface() *string { - if o == nil || IsNil(o.NetworkInterface) || IsNil(o.NetworkInterface.Get()) { - var ret *string - return ret - } - return o.NetworkInterface.Get() +func (o *PublicIp) GetNetworkInterface() (res PublicIpGetNetworkInterfaceRetType) { + res, _ = o.GetNetworkInterfaceOk() + return } // GetNetworkInterfaceOk returns a tuple with the NetworkInterface field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *PublicIp) GetNetworkInterfaceOk() (*string, bool) { - if o == nil || IsNil(o.NetworkInterface) { - return nil, false - } - return o.NetworkInterface.Get(), o.NetworkInterface.IsSet() +func (o *PublicIp) GetNetworkInterfaceOk() (ret PublicIpGetNetworkInterfaceRetType, ok bool) { + return getPublicIpGetNetworkInterfaceAttributeTypeOk(o.NetworkInterface) } // HasNetworkInterface returns a boolean if a field has been set. func (o *PublicIp) HasNetworkInterface() bool { - if o != nil && !IsNil(o.NetworkInterface) && o.NetworkInterface.IsSet() { - return true - } - - return false + _, ok := o.GetNetworkInterfaceOk() + return ok } // SetNetworkInterface gets a reference to the given string and assigns it to the NetworkInterface field. -func (o *PublicIp) SetNetworkInterface(v *string) { - if IsNil(o.NetworkInterface) { - o.NetworkInterface = new(NullableString) - } - o.NetworkInterface.Set(v) +func (o *PublicIp) SetNetworkInterface(v PublicIpGetNetworkInterfaceRetType) { + setPublicIpGetNetworkInterfaceAttributeType(&o.NetworkInterface, v) } // SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil func (o *PublicIp) SetNetworkInterfaceNil() { - if IsNil(o.NetworkInterface) { - o.NetworkInterface = new(NullableString) - } - o.NetworkInterface.Set(nil) + o.NetworkInterface = nil } // UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil func (o *PublicIp) UnsetNetworkInterface() { - if IsNil(o.NetworkInterface) { - o.NetworkInterface = new(NullableString) - } - o.NetworkInterface.Unset() + o.NetworkInterface = nil } func (o PublicIp) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getPublicIpGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Ip) { - toSerialize["ip"] = o.Ip + if val, ok := getPublicIpGetIpAttributeTypeOk(o.Ip); ok { + toSerialize["Ip"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getPublicIpGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if o.NetworkInterface.IsSet() { - toSerialize["networkInterface"] = o.NetworkInterface.Get() + if val, ok := getPublicIpGetNetworkInterfaceAttributeTypeOk(o.NetworkInterface); ok { + toSerialize["NetworkInterface"] = val } return toSerialize, nil } diff --git a/services/iaas/model_public_ip_list_response.go b/services/iaas/model_public_ip_list_response.go index b48d57306..cec014ec7 100644 --- a/services/iaas/model_public_ip_list_response.go +++ b/services/iaas/model_public_ip_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the PublicIpListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &PublicIpListResponse{} +/* + types and functions for items +*/ + +// isArray +type PublicIpListResponseGetItemsAttributeType = *[]PublicIp +type PublicIpListResponseGetItemsArgType = []PublicIp +type PublicIpListResponseGetItemsRetType = []PublicIp + +func getPublicIpListResponseGetItemsAttributeTypeOk(arg PublicIpListResponseGetItemsAttributeType) (ret PublicIpListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPublicIpListResponseGetItemsAttributeType(arg *PublicIpListResponseGetItemsAttributeType, val PublicIpListResponseGetItemsRetType) { + *arg = &val +} + // PublicIpListResponse Public IP list response. type PublicIpListResponse struct { // A list of public IPs. // REQUIRED - Items *[]PublicIp `json:"items"` + Items PublicIpListResponseGetItemsAttributeType `json:"items"` } type _PublicIpListResponse PublicIpListResponse @@ -30,9 +50,9 @@ type _PublicIpListResponse PublicIpListResponse // 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 NewPublicIpListResponse(items *[]PublicIp) *PublicIpListResponse { +func NewPublicIpListResponse(items PublicIpListResponseGetItemsArgType) *PublicIpListResponse { this := PublicIpListResponse{} - this.Items = items + setPublicIpListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewPublicIpListResponseWithDefaults() *PublicIpListResponse { } // GetItems returns the Items field value -func (o *PublicIpListResponse) GetItems() *[]PublicIp { - if o == nil || IsNil(o.Items) { - var ret *[]PublicIp - return ret - } - - return o.Items +func (o *PublicIpListResponse) GetItems() (ret PublicIpListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *PublicIpListResponse) GetItemsOk() (*[]PublicIp, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *PublicIpListResponse) GetItemsOk() (ret PublicIpListResponseGetItemsRetType, ok bool) { + return getPublicIpListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *PublicIpListResponse) SetItems(v *[]PublicIp) { - o.Items = v +func (o *PublicIpListResponse) SetItems(v PublicIpListResponseGetItemsRetType) { + setPublicIpListResponseGetItemsAttributeType(&o.Items, v) } func (o PublicIpListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getPublicIpListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_public_network.go b/services/iaas/model_public_network.go index 8f90f2470..4109646a8 100644 --- a/services/iaas/model_public_network.go +++ b/services/iaas/model_public_network.go @@ -17,11 +17,32 @@ import ( // checks if the PublicNetwork type satisfies the MappedNullable interface at compile time var _ MappedNullable = &PublicNetwork{} +/* + types and functions for cidr +*/ + +// isNotNullableString +type PublicNetworkGetCidrAttributeType = *string + +func getPublicNetworkGetCidrAttributeTypeOk(arg PublicNetworkGetCidrAttributeType) (ret PublicNetworkGetCidrRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPublicNetworkGetCidrAttributeType(arg *PublicNetworkGetCidrAttributeType, val PublicNetworkGetCidrRetType) { + *arg = &val +} + +type PublicNetworkGetCidrArgType = string +type PublicNetworkGetCidrRetType = string + // PublicNetwork Public network. type PublicNetwork struct { // Classless Inter-Domain Routing (CIDR). // REQUIRED - Cidr *string `json:"cidr"` + Cidr PublicNetworkGetCidrAttributeType `json:"cidr"` } type _PublicNetwork PublicNetwork @@ -30,9 +51,9 @@ type _PublicNetwork PublicNetwork // 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 NewPublicNetwork(cidr *string) *PublicNetwork { +func NewPublicNetwork(cidr PublicNetworkGetCidrArgType) *PublicNetwork { this := PublicNetwork{} - this.Cidr = cidr + setPublicNetworkGetCidrAttributeType(&this.Cidr, cidr) return &this } @@ -45,32 +66,27 @@ func NewPublicNetworkWithDefaults() *PublicNetwork { } // GetCidr returns the Cidr field value -func (o *PublicNetwork) GetCidr() *string { - if o == nil || IsNil(o.Cidr) { - var ret *string - return ret - } - - return o.Cidr +func (o *PublicNetwork) GetCidr() (ret PublicNetworkGetCidrRetType) { + ret, _ = o.GetCidrOk() + return ret } // GetCidrOk returns a tuple with the Cidr field value // and a boolean to check if the value has been set. -func (o *PublicNetwork) GetCidrOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Cidr, true +func (o *PublicNetwork) GetCidrOk() (ret PublicNetworkGetCidrRetType, ok bool) { + return getPublicNetworkGetCidrAttributeTypeOk(o.Cidr) } // SetCidr sets field value -func (o *PublicNetwork) SetCidr(v *string) { - o.Cidr = v +func (o *PublicNetwork) SetCidr(v PublicNetworkGetCidrRetType) { + setPublicNetworkGetCidrAttributeType(&o.Cidr, v) } func (o PublicNetwork) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["cidr"] = o.Cidr + if val, ok := getPublicNetworkGetCidrAttributeTypeOk(o.Cidr); ok { + toSerialize["Cidr"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_public_network_list_response.go b/services/iaas/model_public_network_list_response.go index 824189115..69b1088b7 100644 --- a/services/iaas/model_public_network_list_response.go +++ b/services/iaas/model_public_network_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the PublicNetworkListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &PublicNetworkListResponse{} +/* + types and functions for items +*/ + +// isArray +type PublicNetworkListResponseGetItemsAttributeType = *[]PublicNetwork +type PublicNetworkListResponseGetItemsArgType = []PublicNetwork +type PublicNetworkListResponseGetItemsRetType = []PublicNetwork + +func getPublicNetworkListResponseGetItemsAttributeTypeOk(arg PublicNetworkListResponseGetItemsAttributeType) (ret PublicNetworkListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPublicNetworkListResponseGetItemsAttributeType(arg *PublicNetworkListResponseGetItemsAttributeType, val PublicNetworkListResponseGetItemsRetType) { + *arg = &val +} + // PublicNetworkListResponse Public network list response. type PublicNetworkListResponse struct { // A list of public networks. // REQUIRED - Items *[]PublicNetwork `json:"items"` + Items PublicNetworkListResponseGetItemsAttributeType `json:"items"` } type _PublicNetworkListResponse PublicNetworkListResponse @@ -30,9 +50,9 @@ type _PublicNetworkListResponse PublicNetworkListResponse // 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 NewPublicNetworkListResponse(items *[]PublicNetwork) *PublicNetworkListResponse { +func NewPublicNetworkListResponse(items PublicNetworkListResponseGetItemsArgType) *PublicNetworkListResponse { this := PublicNetworkListResponse{} - this.Items = items + setPublicNetworkListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewPublicNetworkListResponseWithDefaults() *PublicNetworkListResponse { } // GetItems returns the Items field value -func (o *PublicNetworkListResponse) GetItems() *[]PublicNetwork { - if o == nil || IsNil(o.Items) { - var ret *[]PublicNetwork - return ret - } - - return o.Items +func (o *PublicNetworkListResponse) GetItems() (ret PublicNetworkListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *PublicNetworkListResponse) GetItemsOk() (*[]PublicNetwork, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *PublicNetworkListResponse) GetItemsOk() (ret PublicNetworkListResponseGetItemsRetType, ok bool) { + return getPublicNetworkListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *PublicNetworkListResponse) SetItems(v *[]PublicNetwork) { - o.Items = v +func (o *PublicNetworkListResponse) SetItems(v PublicNetworkListResponseGetItemsRetType) { + setPublicNetworkListResponseGetItemsAttributeType(&o.Items, v) } func (o PublicNetworkListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getPublicNetworkListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_quota.go b/services/iaas/model_quota.go index e0412dc27..8ba4da4ef 100644 --- a/services/iaas/model_quota.go +++ b/services/iaas/model_quota.go @@ -17,12 +17,52 @@ import ( // checks if the Quota type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Quota{} +/* + types and functions for limit +*/ + +// isLong +type QuotaGetLimitAttributeType = *int64 +type QuotaGetLimitArgType = int64 +type QuotaGetLimitRetType = int64 + +func getQuotaGetLimitAttributeTypeOk(arg QuotaGetLimitAttributeType) (ret QuotaGetLimitRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaGetLimitAttributeType(arg *QuotaGetLimitAttributeType, val QuotaGetLimitRetType) { + *arg = &val +} + +/* + types and functions for usage +*/ + +// isLong +type QuotaGetUsageAttributeType = *int64 +type QuotaGetUsageArgType = int64 +type QuotaGetUsageRetType = int64 + +func getQuotaGetUsageAttributeTypeOk(arg QuotaGetUsageAttributeType) (ret QuotaGetUsageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaGetUsageAttributeType(arg *QuotaGetUsageAttributeType, val QuotaGetUsageRetType) { + *arg = &val +} + // Quota Object that represents a single resource quota. type Quota struct { // REQUIRED - Limit *int64 `json:"limit"` + Limit QuotaGetLimitAttributeType `json:"limit"` // REQUIRED - Usage *int64 `json:"usage"` + Usage QuotaGetUsageAttributeType `json:"usage"` } type _Quota Quota @@ -31,10 +71,10 @@ type _Quota Quota // 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 NewQuota(limit *int64, usage *int64) *Quota { +func NewQuota(limit QuotaGetLimitArgType, usage QuotaGetUsageArgType) *Quota { this := Quota{} - this.Limit = limit - this.Usage = usage + setQuotaGetLimitAttributeType(&this.Limit, limit) + setQuotaGetUsageAttributeType(&this.Usage, usage) return &this } @@ -47,57 +87,47 @@ func NewQuotaWithDefaults() *Quota { } // GetLimit returns the Limit field value -func (o *Quota) GetLimit() *int64 { - if o == nil || IsNil(o.Limit) { - var ret *int64 - return ret - } - - return o.Limit +func (o *Quota) GetLimit() (ret QuotaGetLimitRetType) { + ret, _ = o.GetLimitOk() + return ret } // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. -func (o *Quota) GetLimitOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Limit, true +func (o *Quota) GetLimitOk() (ret QuotaGetLimitRetType, ok bool) { + return getQuotaGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value -func (o *Quota) SetLimit(v *int64) { - o.Limit = v +func (o *Quota) SetLimit(v QuotaGetLimitRetType) { + setQuotaGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value -func (o *Quota) GetUsage() *int64 { - if o == nil || IsNil(o.Usage) { - var ret *int64 - return ret - } - - return o.Usage +func (o *Quota) GetUsage() (ret QuotaGetUsageRetType) { + ret, _ = o.GetUsageOk() + return ret } // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. -func (o *Quota) GetUsageOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Usage, true +func (o *Quota) GetUsageOk() (ret QuotaGetUsageRetType, ok bool) { + return getQuotaGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value -func (o *Quota) SetUsage(v *int64) { - o.Usage = v +func (o *Quota) SetUsage(v QuotaGetUsageRetType) { + setQuotaGetUsageAttributeType(&o.Usage, v) } func (o Quota) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["limit"] = o.Limit - toSerialize["usage"] = o.Usage + if val, ok := getQuotaGetLimitAttributeTypeOk(o.Limit); ok { + toSerialize["Limit"] = val + } + if val, ok := getQuotaGetUsageAttributeTypeOk(o.Usage); ok { + toSerialize["Usage"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_quota_list.go b/services/iaas/model_quota_list.go index cb277f9a4..32b7f4d69 100644 --- a/services/iaas/model_quota_list.go +++ b/services/iaas/model_quota_list.go @@ -17,32 +17,272 @@ import ( // checks if the QuotaList type satisfies the MappedNullable interface at compile time var _ MappedNullable = &QuotaList{} +/* + types and functions for backupGigabytes +*/ + +// isModel +type QuotaListGetBackupGigabytesAttributeType = *QuotaListBackupGigabytes +type QuotaListGetBackupGigabytesArgType = QuotaListBackupGigabytes +type QuotaListGetBackupGigabytesRetType = QuotaListBackupGigabytes + +func getQuotaListGetBackupGigabytesAttributeTypeOk(arg QuotaListGetBackupGigabytesAttributeType) (ret QuotaListGetBackupGigabytesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListGetBackupGigabytesAttributeType(arg *QuotaListGetBackupGigabytesAttributeType, val QuotaListGetBackupGigabytesRetType) { + *arg = &val +} + +/* + types and functions for backups +*/ + +// isModel +type QuotaListGetBackupsAttributeType = *QuotaListBackups +type QuotaListGetBackupsArgType = QuotaListBackups +type QuotaListGetBackupsRetType = QuotaListBackups + +func getQuotaListGetBackupsAttributeTypeOk(arg QuotaListGetBackupsAttributeType) (ret QuotaListGetBackupsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListGetBackupsAttributeType(arg *QuotaListGetBackupsAttributeType, val QuotaListGetBackupsRetType) { + *arg = &val +} + +/* + types and functions for gigabytes +*/ + +// isModel +type QuotaListGetGigabytesAttributeType = *QuotaListGigabytes +type QuotaListGetGigabytesArgType = QuotaListGigabytes +type QuotaListGetGigabytesRetType = QuotaListGigabytes + +func getQuotaListGetGigabytesAttributeTypeOk(arg QuotaListGetGigabytesAttributeType) (ret QuotaListGetGigabytesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListGetGigabytesAttributeType(arg *QuotaListGetGigabytesAttributeType, val QuotaListGetGigabytesRetType) { + *arg = &val +} + +/* + types and functions for networks +*/ + +// isModel +type QuotaListGetNetworksAttributeType = *QuotaListNetworks +type QuotaListGetNetworksArgType = QuotaListNetworks +type QuotaListGetNetworksRetType = QuotaListNetworks + +func getQuotaListGetNetworksAttributeTypeOk(arg QuotaListGetNetworksAttributeType) (ret QuotaListGetNetworksRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListGetNetworksAttributeType(arg *QuotaListGetNetworksAttributeType, val QuotaListGetNetworksRetType) { + *arg = &val +} + +/* + types and functions for nics +*/ + +// isModel +type QuotaListGetNicsAttributeType = *QuotaListNics +type QuotaListGetNicsArgType = QuotaListNics +type QuotaListGetNicsRetType = QuotaListNics + +func getQuotaListGetNicsAttributeTypeOk(arg QuotaListGetNicsAttributeType) (ret QuotaListGetNicsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListGetNicsAttributeType(arg *QuotaListGetNicsAttributeType, val QuotaListGetNicsRetType) { + *arg = &val +} + +/* + types and functions for publicIps +*/ + +// isModel +type QuotaListGetPublicIpsAttributeType = *QuotaListPublicIps +type QuotaListGetPublicIpsArgType = QuotaListPublicIps +type QuotaListGetPublicIpsRetType = QuotaListPublicIps + +func getQuotaListGetPublicIpsAttributeTypeOk(arg QuotaListGetPublicIpsAttributeType) (ret QuotaListGetPublicIpsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListGetPublicIpsAttributeType(arg *QuotaListGetPublicIpsAttributeType, val QuotaListGetPublicIpsRetType) { + *arg = &val +} + +/* + types and functions for ram +*/ + +// isModel +type QuotaListGetRamAttributeType = *QuotaListRam +type QuotaListGetRamArgType = QuotaListRam +type QuotaListGetRamRetType = QuotaListRam + +func getQuotaListGetRamAttributeTypeOk(arg QuotaListGetRamAttributeType) (ret QuotaListGetRamRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListGetRamAttributeType(arg *QuotaListGetRamAttributeType, val QuotaListGetRamRetType) { + *arg = &val +} + +/* + types and functions for securityGroupRules +*/ + +// isModel +type QuotaListGetSecurityGroupRulesAttributeType = *QuotaListSecurityGroupRules +type QuotaListGetSecurityGroupRulesArgType = QuotaListSecurityGroupRules +type QuotaListGetSecurityGroupRulesRetType = QuotaListSecurityGroupRules + +func getQuotaListGetSecurityGroupRulesAttributeTypeOk(arg QuotaListGetSecurityGroupRulesAttributeType) (ret QuotaListGetSecurityGroupRulesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListGetSecurityGroupRulesAttributeType(arg *QuotaListGetSecurityGroupRulesAttributeType, val QuotaListGetSecurityGroupRulesRetType) { + *arg = &val +} + +/* + types and functions for securityGroups +*/ + +// isModel +type QuotaListGetSecurityGroupsAttributeType = *QuotaListSecurityGroups +type QuotaListGetSecurityGroupsArgType = QuotaListSecurityGroups +type QuotaListGetSecurityGroupsRetType = QuotaListSecurityGroups + +func getQuotaListGetSecurityGroupsAttributeTypeOk(arg QuotaListGetSecurityGroupsAttributeType) (ret QuotaListGetSecurityGroupsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListGetSecurityGroupsAttributeType(arg *QuotaListGetSecurityGroupsAttributeType, val QuotaListGetSecurityGroupsRetType) { + *arg = &val +} + +/* + types and functions for snapshots +*/ + +// isModel +type QuotaListGetSnapshotsAttributeType = *QuotaListSnapshots +type QuotaListGetSnapshotsArgType = QuotaListSnapshots +type QuotaListGetSnapshotsRetType = QuotaListSnapshots + +func getQuotaListGetSnapshotsAttributeTypeOk(arg QuotaListGetSnapshotsAttributeType) (ret QuotaListGetSnapshotsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListGetSnapshotsAttributeType(arg *QuotaListGetSnapshotsAttributeType, val QuotaListGetSnapshotsRetType) { + *arg = &val +} + +/* + types and functions for vcpu +*/ + +// isModel +type QuotaListGetVcpuAttributeType = *QuotaListVcpu +type QuotaListGetVcpuArgType = QuotaListVcpu +type QuotaListGetVcpuRetType = QuotaListVcpu + +func getQuotaListGetVcpuAttributeTypeOk(arg QuotaListGetVcpuAttributeType) (ret QuotaListGetVcpuRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListGetVcpuAttributeType(arg *QuotaListGetVcpuAttributeType, val QuotaListGetVcpuRetType) { + *arg = &val +} + +/* + types and functions for volumes +*/ + +// isModel +type QuotaListGetVolumesAttributeType = *QuotaListVolumes +type QuotaListGetVolumesArgType = QuotaListVolumes +type QuotaListGetVolumesRetType = QuotaListVolumes + +func getQuotaListGetVolumesAttributeTypeOk(arg QuotaListGetVolumesAttributeType) (ret QuotaListGetVolumesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListGetVolumesAttributeType(arg *QuotaListGetVolumesAttributeType, val QuotaListGetVolumesRetType) { + *arg = &val +} + // QuotaList Object that represents the quotas for a project. type QuotaList struct { // REQUIRED - BackupGigabytes *QuotaListBackupGigabytes `json:"backupGigabytes"` + BackupGigabytes QuotaListGetBackupGigabytesAttributeType `json:"backupGigabytes"` // REQUIRED - Backups *QuotaListBackups `json:"backups"` + Backups QuotaListGetBackupsAttributeType `json:"backups"` // REQUIRED - Gigabytes *QuotaListGigabytes `json:"gigabytes"` + Gigabytes QuotaListGetGigabytesAttributeType `json:"gigabytes"` // REQUIRED - Networks *QuotaListNetworks `json:"networks"` + Networks QuotaListGetNetworksAttributeType `json:"networks"` // REQUIRED - Nics *QuotaListNics `json:"nics"` + Nics QuotaListGetNicsAttributeType `json:"nics"` // REQUIRED - PublicIps *QuotaListPublicIps `json:"publicIps"` + PublicIps QuotaListGetPublicIpsAttributeType `json:"publicIps"` // REQUIRED - Ram *QuotaListRam `json:"ram"` + Ram QuotaListGetRamAttributeType `json:"ram"` // REQUIRED - SecurityGroupRules *QuotaListSecurityGroupRules `json:"securityGroupRules"` + SecurityGroupRules QuotaListGetSecurityGroupRulesAttributeType `json:"securityGroupRules"` // REQUIRED - SecurityGroups *QuotaListSecurityGroups `json:"securityGroups"` + SecurityGroups QuotaListGetSecurityGroupsAttributeType `json:"securityGroups"` // REQUIRED - Snapshots *QuotaListSnapshots `json:"snapshots"` + Snapshots QuotaListGetSnapshotsAttributeType `json:"snapshots"` // REQUIRED - Vcpu *QuotaListVcpu `json:"vcpu"` + Vcpu QuotaListGetVcpuAttributeType `json:"vcpu"` // REQUIRED - Volumes *QuotaListVolumes `json:"volumes"` + Volumes QuotaListGetVolumesAttributeType `json:"volumes"` } type _QuotaList QuotaList @@ -51,20 +291,20 @@ type _QuotaList QuotaList // 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 NewQuotaList(backupGigabytes *QuotaListBackupGigabytes, backups *QuotaListBackups, gigabytes *QuotaListGigabytes, networks *QuotaListNetworks, nics *QuotaListNics, publicIps *QuotaListPublicIps, ram *QuotaListRam, securityGroupRules *QuotaListSecurityGroupRules, securityGroups *QuotaListSecurityGroups, snapshots *QuotaListSnapshots, vcpu *QuotaListVcpu, volumes *QuotaListVolumes) *QuotaList { +func NewQuotaList(backupGigabytes QuotaListGetBackupGigabytesArgType, backups QuotaListGetBackupsArgType, gigabytes QuotaListGetGigabytesArgType, networks QuotaListGetNetworksArgType, nics QuotaListGetNicsArgType, publicIps QuotaListGetPublicIpsArgType, ram QuotaListGetRamArgType, securityGroupRules QuotaListGetSecurityGroupRulesArgType, securityGroups QuotaListGetSecurityGroupsArgType, snapshots QuotaListGetSnapshotsArgType, vcpu QuotaListGetVcpuArgType, volumes QuotaListGetVolumesArgType) *QuotaList { this := QuotaList{} - this.BackupGigabytes = backupGigabytes - this.Backups = backups - this.Gigabytes = gigabytes - this.Networks = networks - this.Nics = nics - this.PublicIps = publicIps - this.Ram = ram - this.SecurityGroupRules = securityGroupRules - this.SecurityGroups = securityGroups - this.Snapshots = snapshots - this.Vcpu = vcpu - this.Volumes = volumes + setQuotaListGetBackupGigabytesAttributeType(&this.BackupGigabytes, backupGigabytes) + setQuotaListGetBackupsAttributeType(&this.Backups, backups) + setQuotaListGetGigabytesAttributeType(&this.Gigabytes, gigabytes) + setQuotaListGetNetworksAttributeType(&this.Networks, networks) + setQuotaListGetNicsAttributeType(&this.Nics, nics) + setQuotaListGetPublicIpsAttributeType(&this.PublicIps, publicIps) + setQuotaListGetRamAttributeType(&this.Ram, ram) + setQuotaListGetSecurityGroupRulesAttributeType(&this.SecurityGroupRules, securityGroupRules) + setQuotaListGetSecurityGroupsAttributeType(&this.SecurityGroups, securityGroups) + setQuotaListGetSnapshotsAttributeType(&this.Snapshots, snapshots) + setQuotaListGetVcpuAttributeType(&this.Vcpu, vcpu) + setQuotaListGetVolumesAttributeType(&this.Volumes, volumes) return &this } @@ -77,307 +317,247 @@ func NewQuotaListWithDefaults() *QuotaList { } // GetBackupGigabytes returns the BackupGigabytes field value -func (o *QuotaList) GetBackupGigabytes() *QuotaListBackupGigabytes { - if o == nil || IsNil(o.BackupGigabytes) { - var ret *QuotaListBackupGigabytes - return ret - } - - return o.BackupGigabytes +func (o *QuotaList) GetBackupGigabytes() (ret QuotaListGetBackupGigabytesRetType) { + ret, _ = o.GetBackupGigabytesOk() + return ret } // GetBackupGigabytesOk returns a tuple with the BackupGigabytes field value // and a boolean to check if the value has been set. -func (o *QuotaList) GetBackupGigabytesOk() (*QuotaListBackupGigabytes, bool) { - if o == nil { - return nil, false - } - return o.BackupGigabytes, true +func (o *QuotaList) GetBackupGigabytesOk() (ret QuotaListGetBackupGigabytesRetType, ok bool) { + return getQuotaListGetBackupGigabytesAttributeTypeOk(o.BackupGigabytes) } // SetBackupGigabytes sets field value -func (o *QuotaList) SetBackupGigabytes(v *QuotaListBackupGigabytes) { - o.BackupGigabytes = v +func (o *QuotaList) SetBackupGigabytes(v QuotaListGetBackupGigabytesRetType) { + setQuotaListGetBackupGigabytesAttributeType(&o.BackupGigabytes, v) } // GetBackups returns the Backups field value -func (o *QuotaList) GetBackups() *QuotaListBackups { - if o == nil || IsNil(o.Backups) { - var ret *QuotaListBackups - return ret - } - - return o.Backups +func (o *QuotaList) GetBackups() (ret QuotaListGetBackupsRetType) { + ret, _ = o.GetBackupsOk() + return ret } // GetBackupsOk returns a tuple with the Backups field value // and a boolean to check if the value has been set. -func (o *QuotaList) GetBackupsOk() (*QuotaListBackups, bool) { - if o == nil { - return nil, false - } - return o.Backups, true +func (o *QuotaList) GetBackupsOk() (ret QuotaListGetBackupsRetType, ok bool) { + return getQuotaListGetBackupsAttributeTypeOk(o.Backups) } // SetBackups sets field value -func (o *QuotaList) SetBackups(v *QuotaListBackups) { - o.Backups = v +func (o *QuotaList) SetBackups(v QuotaListGetBackupsRetType) { + setQuotaListGetBackupsAttributeType(&o.Backups, v) } // GetGigabytes returns the Gigabytes field value -func (o *QuotaList) GetGigabytes() *QuotaListGigabytes { - if o == nil || IsNil(o.Gigabytes) { - var ret *QuotaListGigabytes - return ret - } - - return o.Gigabytes +func (o *QuotaList) GetGigabytes() (ret QuotaListGetGigabytesRetType) { + ret, _ = o.GetGigabytesOk() + return ret } // GetGigabytesOk returns a tuple with the Gigabytes field value // and a boolean to check if the value has been set. -func (o *QuotaList) GetGigabytesOk() (*QuotaListGigabytes, bool) { - if o == nil { - return nil, false - } - return o.Gigabytes, true +func (o *QuotaList) GetGigabytesOk() (ret QuotaListGetGigabytesRetType, ok bool) { + return getQuotaListGetGigabytesAttributeTypeOk(o.Gigabytes) } // SetGigabytes sets field value -func (o *QuotaList) SetGigabytes(v *QuotaListGigabytes) { - o.Gigabytes = v +func (o *QuotaList) SetGigabytes(v QuotaListGetGigabytesRetType) { + setQuotaListGetGigabytesAttributeType(&o.Gigabytes, v) } // GetNetworks returns the Networks field value -func (o *QuotaList) GetNetworks() *QuotaListNetworks { - if o == nil || IsNil(o.Networks) { - var ret *QuotaListNetworks - return ret - } - - return o.Networks +func (o *QuotaList) GetNetworks() (ret QuotaListGetNetworksRetType) { + ret, _ = o.GetNetworksOk() + return ret } // GetNetworksOk returns a tuple with the Networks field value // and a boolean to check if the value has been set. -func (o *QuotaList) GetNetworksOk() (*QuotaListNetworks, bool) { - if o == nil { - return nil, false - } - return o.Networks, true +func (o *QuotaList) GetNetworksOk() (ret QuotaListGetNetworksRetType, ok bool) { + return getQuotaListGetNetworksAttributeTypeOk(o.Networks) } // SetNetworks sets field value -func (o *QuotaList) SetNetworks(v *QuotaListNetworks) { - o.Networks = v +func (o *QuotaList) SetNetworks(v QuotaListGetNetworksRetType) { + setQuotaListGetNetworksAttributeType(&o.Networks, v) } // GetNics returns the Nics field value -func (o *QuotaList) GetNics() *QuotaListNics { - if o == nil || IsNil(o.Nics) { - var ret *QuotaListNics - return ret - } - - return o.Nics +func (o *QuotaList) GetNics() (ret QuotaListGetNicsRetType) { + ret, _ = o.GetNicsOk() + return ret } // GetNicsOk returns a tuple with the Nics field value // and a boolean to check if the value has been set. -func (o *QuotaList) GetNicsOk() (*QuotaListNics, bool) { - if o == nil { - return nil, false - } - return o.Nics, true +func (o *QuotaList) GetNicsOk() (ret QuotaListGetNicsRetType, ok bool) { + return getQuotaListGetNicsAttributeTypeOk(o.Nics) } // SetNics sets field value -func (o *QuotaList) SetNics(v *QuotaListNics) { - o.Nics = v +func (o *QuotaList) SetNics(v QuotaListGetNicsRetType) { + setQuotaListGetNicsAttributeType(&o.Nics, v) } // GetPublicIps returns the PublicIps field value -func (o *QuotaList) GetPublicIps() *QuotaListPublicIps { - if o == nil || IsNil(o.PublicIps) { - var ret *QuotaListPublicIps - return ret - } - - return o.PublicIps +func (o *QuotaList) GetPublicIps() (ret QuotaListGetPublicIpsRetType) { + ret, _ = o.GetPublicIpsOk() + return ret } // GetPublicIpsOk returns a tuple with the PublicIps field value // and a boolean to check if the value has been set. -func (o *QuotaList) GetPublicIpsOk() (*QuotaListPublicIps, bool) { - if o == nil { - return nil, false - } - return o.PublicIps, true +func (o *QuotaList) GetPublicIpsOk() (ret QuotaListGetPublicIpsRetType, ok bool) { + return getQuotaListGetPublicIpsAttributeTypeOk(o.PublicIps) } // SetPublicIps sets field value -func (o *QuotaList) SetPublicIps(v *QuotaListPublicIps) { - o.PublicIps = v +func (o *QuotaList) SetPublicIps(v QuotaListGetPublicIpsRetType) { + setQuotaListGetPublicIpsAttributeType(&o.PublicIps, v) } // GetRam returns the Ram field value -func (o *QuotaList) GetRam() *QuotaListRam { - if o == nil || IsNil(o.Ram) { - var ret *QuotaListRam - return ret - } - - return o.Ram +func (o *QuotaList) GetRam() (ret QuotaListGetRamRetType) { + ret, _ = o.GetRamOk() + return ret } // GetRamOk returns a tuple with the Ram field value // and a boolean to check if the value has been set. -func (o *QuotaList) GetRamOk() (*QuotaListRam, bool) { - if o == nil { - return nil, false - } - return o.Ram, true +func (o *QuotaList) GetRamOk() (ret QuotaListGetRamRetType, ok bool) { + return getQuotaListGetRamAttributeTypeOk(o.Ram) } // SetRam sets field value -func (o *QuotaList) SetRam(v *QuotaListRam) { - o.Ram = v +func (o *QuotaList) SetRam(v QuotaListGetRamRetType) { + setQuotaListGetRamAttributeType(&o.Ram, v) } // GetSecurityGroupRules returns the SecurityGroupRules field value -func (o *QuotaList) GetSecurityGroupRules() *QuotaListSecurityGroupRules { - if o == nil || IsNil(o.SecurityGroupRules) { - var ret *QuotaListSecurityGroupRules - return ret - } - - return o.SecurityGroupRules +func (o *QuotaList) GetSecurityGroupRules() (ret QuotaListGetSecurityGroupRulesRetType) { + ret, _ = o.GetSecurityGroupRulesOk() + return ret } // GetSecurityGroupRulesOk returns a tuple with the SecurityGroupRules field value // and a boolean to check if the value has been set. -func (o *QuotaList) GetSecurityGroupRulesOk() (*QuotaListSecurityGroupRules, bool) { - if o == nil { - return nil, false - } - return o.SecurityGroupRules, true +func (o *QuotaList) GetSecurityGroupRulesOk() (ret QuotaListGetSecurityGroupRulesRetType, ok bool) { + return getQuotaListGetSecurityGroupRulesAttributeTypeOk(o.SecurityGroupRules) } // SetSecurityGroupRules sets field value -func (o *QuotaList) SetSecurityGroupRules(v *QuotaListSecurityGroupRules) { - o.SecurityGroupRules = v +func (o *QuotaList) SetSecurityGroupRules(v QuotaListGetSecurityGroupRulesRetType) { + setQuotaListGetSecurityGroupRulesAttributeType(&o.SecurityGroupRules, v) } // GetSecurityGroups returns the SecurityGroups field value -func (o *QuotaList) GetSecurityGroups() *QuotaListSecurityGroups { - if o == nil || IsNil(o.SecurityGroups) { - var ret *QuotaListSecurityGroups - return ret - } - - return o.SecurityGroups +func (o *QuotaList) GetSecurityGroups() (ret QuotaListGetSecurityGroupsRetType) { + ret, _ = o.GetSecurityGroupsOk() + return ret } // GetSecurityGroupsOk returns a tuple with the SecurityGroups field value // and a boolean to check if the value has been set. -func (o *QuotaList) GetSecurityGroupsOk() (*QuotaListSecurityGroups, bool) { - if o == nil { - return nil, false - } - return o.SecurityGroups, true +func (o *QuotaList) GetSecurityGroupsOk() (ret QuotaListGetSecurityGroupsRetType, ok bool) { + return getQuotaListGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) } // SetSecurityGroups sets field value -func (o *QuotaList) SetSecurityGroups(v *QuotaListSecurityGroups) { - o.SecurityGroups = v +func (o *QuotaList) SetSecurityGroups(v QuotaListGetSecurityGroupsRetType) { + setQuotaListGetSecurityGroupsAttributeType(&o.SecurityGroups, v) } // GetSnapshots returns the Snapshots field value -func (o *QuotaList) GetSnapshots() *QuotaListSnapshots { - if o == nil || IsNil(o.Snapshots) { - var ret *QuotaListSnapshots - return ret - } - - return o.Snapshots +func (o *QuotaList) GetSnapshots() (ret QuotaListGetSnapshotsRetType) { + ret, _ = o.GetSnapshotsOk() + return ret } // GetSnapshotsOk returns a tuple with the Snapshots field value // and a boolean to check if the value has been set. -func (o *QuotaList) GetSnapshotsOk() (*QuotaListSnapshots, bool) { - if o == nil { - return nil, false - } - return o.Snapshots, true +func (o *QuotaList) GetSnapshotsOk() (ret QuotaListGetSnapshotsRetType, ok bool) { + return getQuotaListGetSnapshotsAttributeTypeOk(o.Snapshots) } // SetSnapshots sets field value -func (o *QuotaList) SetSnapshots(v *QuotaListSnapshots) { - o.Snapshots = v +func (o *QuotaList) SetSnapshots(v QuotaListGetSnapshotsRetType) { + setQuotaListGetSnapshotsAttributeType(&o.Snapshots, v) } // GetVcpu returns the Vcpu field value -func (o *QuotaList) GetVcpu() *QuotaListVcpu { - if o == nil || IsNil(o.Vcpu) { - var ret *QuotaListVcpu - return ret - } - - return o.Vcpu +func (o *QuotaList) GetVcpu() (ret QuotaListGetVcpuRetType) { + ret, _ = o.GetVcpuOk() + return ret } // GetVcpuOk returns a tuple with the Vcpu field value // and a boolean to check if the value has been set. -func (o *QuotaList) GetVcpuOk() (*QuotaListVcpu, bool) { - if o == nil { - return nil, false - } - return o.Vcpu, true +func (o *QuotaList) GetVcpuOk() (ret QuotaListGetVcpuRetType, ok bool) { + return getQuotaListGetVcpuAttributeTypeOk(o.Vcpu) } // SetVcpu sets field value -func (o *QuotaList) SetVcpu(v *QuotaListVcpu) { - o.Vcpu = v +func (o *QuotaList) SetVcpu(v QuotaListGetVcpuRetType) { + setQuotaListGetVcpuAttributeType(&o.Vcpu, v) } // GetVolumes returns the Volumes field value -func (o *QuotaList) GetVolumes() *QuotaListVolumes { - if o == nil || IsNil(o.Volumes) { - var ret *QuotaListVolumes - return ret - } - - return o.Volumes +func (o *QuotaList) GetVolumes() (ret QuotaListGetVolumesRetType) { + ret, _ = o.GetVolumesOk() + return ret } // GetVolumesOk returns a tuple with the Volumes field value // and a boolean to check if the value has been set. -func (o *QuotaList) GetVolumesOk() (*QuotaListVolumes, bool) { - if o == nil { - return nil, false - } - return o.Volumes, true +func (o *QuotaList) GetVolumesOk() (ret QuotaListGetVolumesRetType, ok bool) { + return getQuotaListGetVolumesAttributeTypeOk(o.Volumes) } // SetVolumes sets field value -func (o *QuotaList) SetVolumes(v *QuotaListVolumes) { - o.Volumes = v +func (o *QuotaList) SetVolumes(v QuotaListGetVolumesRetType) { + setQuotaListGetVolumesAttributeType(&o.Volumes, v) } func (o QuotaList) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["backupGigabytes"] = o.BackupGigabytes - toSerialize["backups"] = o.Backups - toSerialize["gigabytes"] = o.Gigabytes - toSerialize["networks"] = o.Networks - toSerialize["nics"] = o.Nics - toSerialize["publicIps"] = o.PublicIps - toSerialize["ram"] = o.Ram - toSerialize["securityGroupRules"] = o.SecurityGroupRules - toSerialize["securityGroups"] = o.SecurityGroups - toSerialize["snapshots"] = o.Snapshots - toSerialize["vcpu"] = o.Vcpu - toSerialize["volumes"] = o.Volumes + if val, ok := getQuotaListGetBackupGigabytesAttributeTypeOk(o.BackupGigabytes); ok { + toSerialize["BackupGigabytes"] = val + } + if val, ok := getQuotaListGetBackupsAttributeTypeOk(o.Backups); ok { + toSerialize["Backups"] = val + } + if val, ok := getQuotaListGetGigabytesAttributeTypeOk(o.Gigabytes); ok { + toSerialize["Gigabytes"] = val + } + if val, ok := getQuotaListGetNetworksAttributeTypeOk(o.Networks); ok { + toSerialize["Networks"] = val + } + if val, ok := getQuotaListGetNicsAttributeTypeOk(o.Nics); ok { + toSerialize["Nics"] = val + } + if val, ok := getQuotaListGetPublicIpsAttributeTypeOk(o.PublicIps); ok { + toSerialize["PublicIps"] = val + } + if val, ok := getQuotaListGetRamAttributeTypeOk(o.Ram); ok { + toSerialize["Ram"] = val + } + if val, ok := getQuotaListGetSecurityGroupRulesAttributeTypeOk(o.SecurityGroupRules); ok { + toSerialize["SecurityGroupRules"] = val + } + if val, ok := getQuotaListGetSecurityGroupsAttributeTypeOk(o.SecurityGroups); ok { + toSerialize["SecurityGroups"] = val + } + if val, ok := getQuotaListGetSnapshotsAttributeTypeOk(o.Snapshots); ok { + toSerialize["Snapshots"] = val + } + if val, ok := getQuotaListGetVcpuAttributeTypeOk(o.Vcpu); ok { + toSerialize["Vcpu"] = val + } + if val, ok := getQuotaListGetVolumesAttributeTypeOk(o.Volumes); ok { + toSerialize["Volumes"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_quota_list_backup_gigabytes.go b/services/iaas/model_quota_list_backup_gigabytes.go index 533bd7390..af1c79430 100644 --- a/services/iaas/model_quota_list_backup_gigabytes.go +++ b/services/iaas/model_quota_list_backup_gigabytes.go @@ -17,12 +17,52 @@ import ( // checks if the QuotaListBackupGigabytes type satisfies the MappedNullable interface at compile time var _ MappedNullable = &QuotaListBackupGigabytes{} +/* + types and functions for limit +*/ + +// isLong +type QuotaListBackupGigabytesGetLimitAttributeType = *int64 +type QuotaListBackupGigabytesGetLimitArgType = int64 +type QuotaListBackupGigabytesGetLimitRetType = int64 + +func getQuotaListBackupGigabytesGetLimitAttributeTypeOk(arg QuotaListBackupGigabytesGetLimitAttributeType) (ret QuotaListBackupGigabytesGetLimitRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListBackupGigabytesGetLimitAttributeType(arg *QuotaListBackupGigabytesGetLimitAttributeType, val QuotaListBackupGigabytesGetLimitRetType) { + *arg = &val +} + +/* + types and functions for usage +*/ + +// isLong +type QuotaListBackupGigabytesGetUsageAttributeType = *int64 +type QuotaListBackupGigabytesGetUsageArgType = int64 +type QuotaListBackupGigabytesGetUsageRetType = int64 + +func getQuotaListBackupGigabytesGetUsageAttributeTypeOk(arg QuotaListBackupGigabytesGetUsageAttributeType) (ret QuotaListBackupGigabytesGetUsageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListBackupGigabytesGetUsageAttributeType(arg *QuotaListBackupGigabytesGetUsageAttributeType, val QuotaListBackupGigabytesGetUsageRetType) { + *arg = &val +} + // QuotaListBackupGigabytes Total size in GiB of backups. type QuotaListBackupGigabytes struct { // REQUIRED - Limit *int64 `json:"limit"` + Limit QuotaListBackupGigabytesGetLimitAttributeType `json:"limit"` // REQUIRED - Usage *int64 `json:"usage"` + Usage QuotaListBackupGigabytesGetUsageAttributeType `json:"usage"` } type _QuotaListBackupGigabytes QuotaListBackupGigabytes @@ -31,10 +71,10 @@ type _QuotaListBackupGigabytes QuotaListBackupGigabytes // 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 NewQuotaListBackupGigabytes(limit *int64, usage *int64) *QuotaListBackupGigabytes { +func NewQuotaListBackupGigabytes(limit QuotaListBackupGigabytesGetLimitArgType, usage QuotaListBackupGigabytesGetUsageArgType) *QuotaListBackupGigabytes { this := QuotaListBackupGigabytes{} - this.Limit = limit - this.Usage = usage + setQuotaListBackupGigabytesGetLimitAttributeType(&this.Limit, limit) + setQuotaListBackupGigabytesGetUsageAttributeType(&this.Usage, usage) return &this } @@ -47,57 +87,47 @@ func NewQuotaListBackupGigabytesWithDefaults() *QuotaListBackupGigabytes { } // GetLimit returns the Limit field value -func (o *QuotaListBackupGigabytes) GetLimit() *int64 { - if o == nil || IsNil(o.Limit) { - var ret *int64 - return ret - } - - return o.Limit +func (o *QuotaListBackupGigabytes) GetLimit() (ret QuotaListBackupGigabytesGetLimitRetType) { + ret, _ = o.GetLimitOk() + return ret } // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. -func (o *QuotaListBackupGigabytes) GetLimitOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Limit, true +func (o *QuotaListBackupGigabytes) GetLimitOk() (ret QuotaListBackupGigabytesGetLimitRetType, ok bool) { + return getQuotaListBackupGigabytesGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value -func (o *QuotaListBackupGigabytes) SetLimit(v *int64) { - o.Limit = v +func (o *QuotaListBackupGigabytes) SetLimit(v QuotaListBackupGigabytesGetLimitRetType) { + setQuotaListBackupGigabytesGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value -func (o *QuotaListBackupGigabytes) GetUsage() *int64 { - if o == nil || IsNil(o.Usage) { - var ret *int64 - return ret - } - - return o.Usage +func (o *QuotaListBackupGigabytes) GetUsage() (ret QuotaListBackupGigabytesGetUsageRetType) { + ret, _ = o.GetUsageOk() + return ret } // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. -func (o *QuotaListBackupGigabytes) GetUsageOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Usage, true +func (o *QuotaListBackupGigabytes) GetUsageOk() (ret QuotaListBackupGigabytesGetUsageRetType, ok bool) { + return getQuotaListBackupGigabytesGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value -func (o *QuotaListBackupGigabytes) SetUsage(v *int64) { - o.Usage = v +func (o *QuotaListBackupGigabytes) SetUsage(v QuotaListBackupGigabytesGetUsageRetType) { + setQuotaListBackupGigabytesGetUsageAttributeType(&o.Usage, v) } func (o QuotaListBackupGigabytes) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["limit"] = o.Limit - toSerialize["usage"] = o.Usage + if val, ok := getQuotaListBackupGigabytesGetLimitAttributeTypeOk(o.Limit); ok { + toSerialize["Limit"] = val + } + if val, ok := getQuotaListBackupGigabytesGetUsageAttributeTypeOk(o.Usage); ok { + toSerialize["Usage"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_quota_list_backups.go b/services/iaas/model_quota_list_backups.go index b2d12d61a..94d47a746 100644 --- a/services/iaas/model_quota_list_backups.go +++ b/services/iaas/model_quota_list_backups.go @@ -17,12 +17,52 @@ import ( // checks if the QuotaListBackups type satisfies the MappedNullable interface at compile time var _ MappedNullable = &QuotaListBackups{} +/* + types and functions for limit +*/ + +// isLong +type QuotaListBackupsGetLimitAttributeType = *int64 +type QuotaListBackupsGetLimitArgType = int64 +type QuotaListBackupsGetLimitRetType = int64 + +func getQuotaListBackupsGetLimitAttributeTypeOk(arg QuotaListBackupsGetLimitAttributeType) (ret QuotaListBackupsGetLimitRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListBackupsGetLimitAttributeType(arg *QuotaListBackupsGetLimitAttributeType, val QuotaListBackupsGetLimitRetType) { + *arg = &val +} + +/* + types and functions for usage +*/ + +// isLong +type QuotaListBackupsGetUsageAttributeType = *int64 +type QuotaListBackupsGetUsageArgType = int64 +type QuotaListBackupsGetUsageRetType = int64 + +func getQuotaListBackupsGetUsageAttributeTypeOk(arg QuotaListBackupsGetUsageAttributeType) (ret QuotaListBackupsGetUsageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListBackupsGetUsageAttributeType(arg *QuotaListBackupsGetUsageAttributeType, val QuotaListBackupsGetUsageRetType) { + *arg = &val +} + // QuotaListBackups Number of backups. type QuotaListBackups struct { // REQUIRED - Limit *int64 `json:"limit"` + Limit QuotaListBackupsGetLimitAttributeType `json:"limit"` // REQUIRED - Usage *int64 `json:"usage"` + Usage QuotaListBackupsGetUsageAttributeType `json:"usage"` } type _QuotaListBackups QuotaListBackups @@ -31,10 +71,10 @@ type _QuotaListBackups QuotaListBackups // 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 NewQuotaListBackups(limit *int64, usage *int64) *QuotaListBackups { +func NewQuotaListBackups(limit QuotaListBackupsGetLimitArgType, usage QuotaListBackupsGetUsageArgType) *QuotaListBackups { this := QuotaListBackups{} - this.Limit = limit - this.Usage = usage + setQuotaListBackupsGetLimitAttributeType(&this.Limit, limit) + setQuotaListBackupsGetUsageAttributeType(&this.Usage, usage) return &this } @@ -47,57 +87,47 @@ func NewQuotaListBackupsWithDefaults() *QuotaListBackups { } // GetLimit returns the Limit field value -func (o *QuotaListBackups) GetLimit() *int64 { - if o == nil || IsNil(o.Limit) { - var ret *int64 - return ret - } - - return o.Limit +func (o *QuotaListBackups) GetLimit() (ret QuotaListBackupsGetLimitRetType) { + ret, _ = o.GetLimitOk() + return ret } // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. -func (o *QuotaListBackups) GetLimitOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Limit, true +func (o *QuotaListBackups) GetLimitOk() (ret QuotaListBackupsGetLimitRetType, ok bool) { + return getQuotaListBackupsGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value -func (o *QuotaListBackups) SetLimit(v *int64) { - o.Limit = v +func (o *QuotaListBackups) SetLimit(v QuotaListBackupsGetLimitRetType) { + setQuotaListBackupsGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value -func (o *QuotaListBackups) GetUsage() *int64 { - if o == nil || IsNil(o.Usage) { - var ret *int64 - return ret - } - - return o.Usage +func (o *QuotaListBackups) GetUsage() (ret QuotaListBackupsGetUsageRetType) { + ret, _ = o.GetUsageOk() + return ret } // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. -func (o *QuotaListBackups) GetUsageOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Usage, true +func (o *QuotaListBackups) GetUsageOk() (ret QuotaListBackupsGetUsageRetType, ok bool) { + return getQuotaListBackupsGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value -func (o *QuotaListBackups) SetUsage(v *int64) { - o.Usage = v +func (o *QuotaListBackups) SetUsage(v QuotaListBackupsGetUsageRetType) { + setQuotaListBackupsGetUsageAttributeType(&o.Usage, v) } func (o QuotaListBackups) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["limit"] = o.Limit - toSerialize["usage"] = o.Usage + if val, ok := getQuotaListBackupsGetLimitAttributeTypeOk(o.Limit); ok { + toSerialize["Limit"] = val + } + if val, ok := getQuotaListBackupsGetUsageAttributeTypeOk(o.Usage); ok { + toSerialize["Usage"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_quota_list_gigabytes.go b/services/iaas/model_quota_list_gigabytes.go index ee40de718..1cc1cc3af 100644 --- a/services/iaas/model_quota_list_gigabytes.go +++ b/services/iaas/model_quota_list_gigabytes.go @@ -17,12 +17,52 @@ import ( // checks if the QuotaListGigabytes type satisfies the MappedNullable interface at compile time var _ MappedNullable = &QuotaListGigabytes{} +/* + types and functions for limit +*/ + +// isLong +type QuotaListGigabytesGetLimitAttributeType = *int64 +type QuotaListGigabytesGetLimitArgType = int64 +type QuotaListGigabytesGetLimitRetType = int64 + +func getQuotaListGigabytesGetLimitAttributeTypeOk(arg QuotaListGigabytesGetLimitAttributeType) (ret QuotaListGigabytesGetLimitRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListGigabytesGetLimitAttributeType(arg *QuotaListGigabytesGetLimitAttributeType, val QuotaListGigabytesGetLimitRetType) { + *arg = &val +} + +/* + types and functions for usage +*/ + +// isLong +type QuotaListGigabytesGetUsageAttributeType = *int64 +type QuotaListGigabytesGetUsageArgType = int64 +type QuotaListGigabytesGetUsageRetType = int64 + +func getQuotaListGigabytesGetUsageAttributeTypeOk(arg QuotaListGigabytesGetUsageAttributeType) (ret QuotaListGigabytesGetUsageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListGigabytesGetUsageAttributeType(arg *QuotaListGigabytesGetUsageAttributeType, val QuotaListGigabytesGetUsageRetType) { + *arg = &val +} + // QuotaListGigabytes Total size in GiB of volumes and snapshots. type QuotaListGigabytes struct { // REQUIRED - Limit *int64 `json:"limit"` + Limit QuotaListGigabytesGetLimitAttributeType `json:"limit"` // REQUIRED - Usage *int64 `json:"usage"` + Usage QuotaListGigabytesGetUsageAttributeType `json:"usage"` } type _QuotaListGigabytes QuotaListGigabytes @@ -31,10 +71,10 @@ type _QuotaListGigabytes QuotaListGigabytes // 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 NewQuotaListGigabytes(limit *int64, usage *int64) *QuotaListGigabytes { +func NewQuotaListGigabytes(limit QuotaListGigabytesGetLimitArgType, usage QuotaListGigabytesGetUsageArgType) *QuotaListGigabytes { this := QuotaListGigabytes{} - this.Limit = limit - this.Usage = usage + setQuotaListGigabytesGetLimitAttributeType(&this.Limit, limit) + setQuotaListGigabytesGetUsageAttributeType(&this.Usage, usage) return &this } @@ -47,57 +87,47 @@ func NewQuotaListGigabytesWithDefaults() *QuotaListGigabytes { } // GetLimit returns the Limit field value -func (o *QuotaListGigabytes) GetLimit() *int64 { - if o == nil || IsNil(o.Limit) { - var ret *int64 - return ret - } - - return o.Limit +func (o *QuotaListGigabytes) GetLimit() (ret QuotaListGigabytesGetLimitRetType) { + ret, _ = o.GetLimitOk() + return ret } // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. -func (o *QuotaListGigabytes) GetLimitOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Limit, true +func (o *QuotaListGigabytes) GetLimitOk() (ret QuotaListGigabytesGetLimitRetType, ok bool) { + return getQuotaListGigabytesGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value -func (o *QuotaListGigabytes) SetLimit(v *int64) { - o.Limit = v +func (o *QuotaListGigabytes) SetLimit(v QuotaListGigabytesGetLimitRetType) { + setQuotaListGigabytesGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value -func (o *QuotaListGigabytes) GetUsage() *int64 { - if o == nil || IsNil(o.Usage) { - var ret *int64 - return ret - } - - return o.Usage +func (o *QuotaListGigabytes) GetUsage() (ret QuotaListGigabytesGetUsageRetType) { + ret, _ = o.GetUsageOk() + return ret } // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. -func (o *QuotaListGigabytes) GetUsageOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Usage, true +func (o *QuotaListGigabytes) GetUsageOk() (ret QuotaListGigabytesGetUsageRetType, ok bool) { + return getQuotaListGigabytesGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value -func (o *QuotaListGigabytes) SetUsage(v *int64) { - o.Usage = v +func (o *QuotaListGigabytes) SetUsage(v QuotaListGigabytesGetUsageRetType) { + setQuotaListGigabytesGetUsageAttributeType(&o.Usage, v) } func (o QuotaListGigabytes) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["limit"] = o.Limit - toSerialize["usage"] = o.Usage + if val, ok := getQuotaListGigabytesGetLimitAttributeTypeOk(o.Limit); ok { + toSerialize["Limit"] = val + } + if val, ok := getQuotaListGigabytesGetUsageAttributeTypeOk(o.Usage); ok { + toSerialize["Usage"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_quota_list_networks.go b/services/iaas/model_quota_list_networks.go index 664c40676..268d5a980 100644 --- a/services/iaas/model_quota_list_networks.go +++ b/services/iaas/model_quota_list_networks.go @@ -17,12 +17,52 @@ import ( // checks if the QuotaListNetworks type satisfies the MappedNullable interface at compile time var _ MappedNullable = &QuotaListNetworks{} +/* + types and functions for limit +*/ + +// isLong +type QuotaListNetworksGetLimitAttributeType = *int64 +type QuotaListNetworksGetLimitArgType = int64 +type QuotaListNetworksGetLimitRetType = int64 + +func getQuotaListNetworksGetLimitAttributeTypeOk(arg QuotaListNetworksGetLimitAttributeType) (ret QuotaListNetworksGetLimitRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListNetworksGetLimitAttributeType(arg *QuotaListNetworksGetLimitAttributeType, val QuotaListNetworksGetLimitRetType) { + *arg = &val +} + +/* + types and functions for usage +*/ + +// isLong +type QuotaListNetworksGetUsageAttributeType = *int64 +type QuotaListNetworksGetUsageArgType = int64 +type QuotaListNetworksGetUsageRetType = int64 + +func getQuotaListNetworksGetUsageAttributeTypeOk(arg QuotaListNetworksGetUsageAttributeType) (ret QuotaListNetworksGetUsageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListNetworksGetUsageAttributeType(arg *QuotaListNetworksGetUsageAttributeType, val QuotaListNetworksGetUsageRetType) { + *arg = &val +} + // QuotaListNetworks Number of networks. type QuotaListNetworks struct { // REQUIRED - Limit *int64 `json:"limit"` + Limit QuotaListNetworksGetLimitAttributeType `json:"limit"` // REQUIRED - Usage *int64 `json:"usage"` + Usage QuotaListNetworksGetUsageAttributeType `json:"usage"` } type _QuotaListNetworks QuotaListNetworks @@ -31,10 +71,10 @@ type _QuotaListNetworks QuotaListNetworks // 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 NewQuotaListNetworks(limit *int64, usage *int64) *QuotaListNetworks { +func NewQuotaListNetworks(limit QuotaListNetworksGetLimitArgType, usage QuotaListNetworksGetUsageArgType) *QuotaListNetworks { this := QuotaListNetworks{} - this.Limit = limit - this.Usage = usage + setQuotaListNetworksGetLimitAttributeType(&this.Limit, limit) + setQuotaListNetworksGetUsageAttributeType(&this.Usage, usage) return &this } @@ -47,57 +87,47 @@ func NewQuotaListNetworksWithDefaults() *QuotaListNetworks { } // GetLimit returns the Limit field value -func (o *QuotaListNetworks) GetLimit() *int64 { - if o == nil || IsNil(o.Limit) { - var ret *int64 - return ret - } - - return o.Limit +func (o *QuotaListNetworks) GetLimit() (ret QuotaListNetworksGetLimitRetType) { + ret, _ = o.GetLimitOk() + return ret } // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. -func (o *QuotaListNetworks) GetLimitOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Limit, true +func (o *QuotaListNetworks) GetLimitOk() (ret QuotaListNetworksGetLimitRetType, ok bool) { + return getQuotaListNetworksGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value -func (o *QuotaListNetworks) SetLimit(v *int64) { - o.Limit = v +func (o *QuotaListNetworks) SetLimit(v QuotaListNetworksGetLimitRetType) { + setQuotaListNetworksGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value -func (o *QuotaListNetworks) GetUsage() *int64 { - if o == nil || IsNil(o.Usage) { - var ret *int64 - return ret - } - - return o.Usage +func (o *QuotaListNetworks) GetUsage() (ret QuotaListNetworksGetUsageRetType) { + ret, _ = o.GetUsageOk() + return ret } // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. -func (o *QuotaListNetworks) GetUsageOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Usage, true +func (o *QuotaListNetworks) GetUsageOk() (ret QuotaListNetworksGetUsageRetType, ok bool) { + return getQuotaListNetworksGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value -func (o *QuotaListNetworks) SetUsage(v *int64) { - o.Usage = v +func (o *QuotaListNetworks) SetUsage(v QuotaListNetworksGetUsageRetType) { + setQuotaListNetworksGetUsageAttributeType(&o.Usage, v) } func (o QuotaListNetworks) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["limit"] = o.Limit - toSerialize["usage"] = o.Usage + if val, ok := getQuotaListNetworksGetLimitAttributeTypeOk(o.Limit); ok { + toSerialize["Limit"] = val + } + if val, ok := getQuotaListNetworksGetUsageAttributeTypeOk(o.Usage); ok { + toSerialize["Usage"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_quota_list_nics.go b/services/iaas/model_quota_list_nics.go index 21114db78..20b966445 100644 --- a/services/iaas/model_quota_list_nics.go +++ b/services/iaas/model_quota_list_nics.go @@ -17,12 +17,52 @@ import ( // checks if the QuotaListNics type satisfies the MappedNullable interface at compile time var _ MappedNullable = &QuotaListNics{} +/* + types and functions for limit +*/ + +// isLong +type QuotaListNicsGetLimitAttributeType = *int64 +type QuotaListNicsGetLimitArgType = int64 +type QuotaListNicsGetLimitRetType = int64 + +func getQuotaListNicsGetLimitAttributeTypeOk(arg QuotaListNicsGetLimitAttributeType) (ret QuotaListNicsGetLimitRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListNicsGetLimitAttributeType(arg *QuotaListNicsGetLimitAttributeType, val QuotaListNicsGetLimitRetType) { + *arg = &val +} + +/* + types and functions for usage +*/ + +// isLong +type QuotaListNicsGetUsageAttributeType = *int64 +type QuotaListNicsGetUsageArgType = int64 +type QuotaListNicsGetUsageRetType = int64 + +func getQuotaListNicsGetUsageAttributeTypeOk(arg QuotaListNicsGetUsageAttributeType) (ret QuotaListNicsGetUsageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListNicsGetUsageAttributeType(arg *QuotaListNicsGetUsageAttributeType, val QuotaListNicsGetUsageRetType) { + *arg = &val +} + // QuotaListNics Number of network interfaces. type QuotaListNics struct { // REQUIRED - Limit *int64 `json:"limit"` + Limit QuotaListNicsGetLimitAttributeType `json:"limit"` // REQUIRED - Usage *int64 `json:"usage"` + Usage QuotaListNicsGetUsageAttributeType `json:"usage"` } type _QuotaListNics QuotaListNics @@ -31,10 +71,10 @@ type _QuotaListNics QuotaListNics // 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 NewQuotaListNics(limit *int64, usage *int64) *QuotaListNics { +func NewQuotaListNics(limit QuotaListNicsGetLimitArgType, usage QuotaListNicsGetUsageArgType) *QuotaListNics { this := QuotaListNics{} - this.Limit = limit - this.Usage = usage + setQuotaListNicsGetLimitAttributeType(&this.Limit, limit) + setQuotaListNicsGetUsageAttributeType(&this.Usage, usage) return &this } @@ -47,57 +87,47 @@ func NewQuotaListNicsWithDefaults() *QuotaListNics { } // GetLimit returns the Limit field value -func (o *QuotaListNics) GetLimit() *int64 { - if o == nil || IsNil(o.Limit) { - var ret *int64 - return ret - } - - return o.Limit +func (o *QuotaListNics) GetLimit() (ret QuotaListNicsGetLimitRetType) { + ret, _ = o.GetLimitOk() + return ret } // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. -func (o *QuotaListNics) GetLimitOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Limit, true +func (o *QuotaListNics) GetLimitOk() (ret QuotaListNicsGetLimitRetType, ok bool) { + return getQuotaListNicsGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value -func (o *QuotaListNics) SetLimit(v *int64) { - o.Limit = v +func (o *QuotaListNics) SetLimit(v QuotaListNicsGetLimitRetType) { + setQuotaListNicsGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value -func (o *QuotaListNics) GetUsage() *int64 { - if o == nil || IsNil(o.Usage) { - var ret *int64 - return ret - } - - return o.Usage +func (o *QuotaListNics) GetUsage() (ret QuotaListNicsGetUsageRetType) { + ret, _ = o.GetUsageOk() + return ret } // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. -func (o *QuotaListNics) GetUsageOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Usage, true +func (o *QuotaListNics) GetUsageOk() (ret QuotaListNicsGetUsageRetType, ok bool) { + return getQuotaListNicsGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value -func (o *QuotaListNics) SetUsage(v *int64) { - o.Usage = v +func (o *QuotaListNics) SetUsage(v QuotaListNicsGetUsageRetType) { + setQuotaListNicsGetUsageAttributeType(&o.Usage, v) } func (o QuotaListNics) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["limit"] = o.Limit - toSerialize["usage"] = o.Usage + if val, ok := getQuotaListNicsGetLimitAttributeTypeOk(o.Limit); ok { + toSerialize["Limit"] = val + } + if val, ok := getQuotaListNicsGetUsageAttributeTypeOk(o.Usage); ok { + toSerialize["Usage"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_quota_list_public_ips.go b/services/iaas/model_quota_list_public_ips.go index 345a33f52..ea7448376 100644 --- a/services/iaas/model_quota_list_public_ips.go +++ b/services/iaas/model_quota_list_public_ips.go @@ -17,12 +17,52 @@ import ( // checks if the QuotaListPublicIps type satisfies the MappedNullable interface at compile time var _ MappedNullable = &QuotaListPublicIps{} +/* + types and functions for limit +*/ + +// isLong +type QuotaListPublicIpsGetLimitAttributeType = *int64 +type QuotaListPublicIpsGetLimitArgType = int64 +type QuotaListPublicIpsGetLimitRetType = int64 + +func getQuotaListPublicIpsGetLimitAttributeTypeOk(arg QuotaListPublicIpsGetLimitAttributeType) (ret QuotaListPublicIpsGetLimitRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListPublicIpsGetLimitAttributeType(arg *QuotaListPublicIpsGetLimitAttributeType, val QuotaListPublicIpsGetLimitRetType) { + *arg = &val +} + +/* + types and functions for usage +*/ + +// isLong +type QuotaListPublicIpsGetUsageAttributeType = *int64 +type QuotaListPublicIpsGetUsageArgType = int64 +type QuotaListPublicIpsGetUsageRetType = int64 + +func getQuotaListPublicIpsGetUsageAttributeTypeOk(arg QuotaListPublicIpsGetUsageAttributeType) (ret QuotaListPublicIpsGetUsageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListPublicIpsGetUsageAttributeType(arg *QuotaListPublicIpsGetUsageAttributeType, val QuotaListPublicIpsGetUsageRetType) { + *arg = &val +} + // QuotaListPublicIps Number of public IP addresses. type QuotaListPublicIps struct { // REQUIRED - Limit *int64 `json:"limit"` + Limit QuotaListPublicIpsGetLimitAttributeType `json:"limit"` // REQUIRED - Usage *int64 `json:"usage"` + Usage QuotaListPublicIpsGetUsageAttributeType `json:"usage"` } type _QuotaListPublicIps QuotaListPublicIps @@ -31,10 +71,10 @@ type _QuotaListPublicIps QuotaListPublicIps // 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 NewQuotaListPublicIps(limit *int64, usage *int64) *QuotaListPublicIps { +func NewQuotaListPublicIps(limit QuotaListPublicIpsGetLimitArgType, usage QuotaListPublicIpsGetUsageArgType) *QuotaListPublicIps { this := QuotaListPublicIps{} - this.Limit = limit - this.Usage = usage + setQuotaListPublicIpsGetLimitAttributeType(&this.Limit, limit) + setQuotaListPublicIpsGetUsageAttributeType(&this.Usage, usage) return &this } @@ -47,57 +87,47 @@ func NewQuotaListPublicIpsWithDefaults() *QuotaListPublicIps { } // GetLimit returns the Limit field value -func (o *QuotaListPublicIps) GetLimit() *int64 { - if o == nil || IsNil(o.Limit) { - var ret *int64 - return ret - } - - return o.Limit +func (o *QuotaListPublicIps) GetLimit() (ret QuotaListPublicIpsGetLimitRetType) { + ret, _ = o.GetLimitOk() + return ret } // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. -func (o *QuotaListPublicIps) GetLimitOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Limit, true +func (o *QuotaListPublicIps) GetLimitOk() (ret QuotaListPublicIpsGetLimitRetType, ok bool) { + return getQuotaListPublicIpsGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value -func (o *QuotaListPublicIps) SetLimit(v *int64) { - o.Limit = v +func (o *QuotaListPublicIps) SetLimit(v QuotaListPublicIpsGetLimitRetType) { + setQuotaListPublicIpsGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value -func (o *QuotaListPublicIps) GetUsage() *int64 { - if o == nil || IsNil(o.Usage) { - var ret *int64 - return ret - } - - return o.Usage +func (o *QuotaListPublicIps) GetUsage() (ret QuotaListPublicIpsGetUsageRetType) { + ret, _ = o.GetUsageOk() + return ret } // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. -func (o *QuotaListPublicIps) GetUsageOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Usage, true +func (o *QuotaListPublicIps) GetUsageOk() (ret QuotaListPublicIpsGetUsageRetType, ok bool) { + return getQuotaListPublicIpsGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value -func (o *QuotaListPublicIps) SetUsage(v *int64) { - o.Usage = v +func (o *QuotaListPublicIps) SetUsage(v QuotaListPublicIpsGetUsageRetType) { + setQuotaListPublicIpsGetUsageAttributeType(&o.Usage, v) } func (o QuotaListPublicIps) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["limit"] = o.Limit - toSerialize["usage"] = o.Usage + if val, ok := getQuotaListPublicIpsGetLimitAttributeTypeOk(o.Limit); ok { + toSerialize["Limit"] = val + } + if val, ok := getQuotaListPublicIpsGetUsageAttributeTypeOk(o.Usage); ok { + toSerialize["Usage"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_quota_list_ram.go b/services/iaas/model_quota_list_ram.go index 896357695..349b3553d 100644 --- a/services/iaas/model_quota_list_ram.go +++ b/services/iaas/model_quota_list_ram.go @@ -17,12 +17,52 @@ import ( // checks if the QuotaListRam type satisfies the MappedNullable interface at compile time var _ MappedNullable = &QuotaListRam{} +/* + types and functions for limit +*/ + +// isLong +type QuotaListRamGetLimitAttributeType = *int64 +type QuotaListRamGetLimitArgType = int64 +type QuotaListRamGetLimitRetType = int64 + +func getQuotaListRamGetLimitAttributeTypeOk(arg QuotaListRamGetLimitAttributeType) (ret QuotaListRamGetLimitRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListRamGetLimitAttributeType(arg *QuotaListRamGetLimitAttributeType, val QuotaListRamGetLimitRetType) { + *arg = &val +} + +/* + types and functions for usage +*/ + +// isLong +type QuotaListRamGetUsageAttributeType = *int64 +type QuotaListRamGetUsageArgType = int64 +type QuotaListRamGetUsageRetType = int64 + +func getQuotaListRamGetUsageAttributeTypeOk(arg QuotaListRamGetUsageAttributeType) (ret QuotaListRamGetUsageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListRamGetUsageAttributeType(arg *QuotaListRamGetUsageAttributeType, val QuotaListRamGetUsageRetType) { + *arg = &val +} + // QuotaListRam Amount of server RAM in MiB. type QuotaListRam struct { // REQUIRED - Limit *int64 `json:"limit"` + Limit QuotaListRamGetLimitAttributeType `json:"limit"` // REQUIRED - Usage *int64 `json:"usage"` + Usage QuotaListRamGetUsageAttributeType `json:"usage"` } type _QuotaListRam QuotaListRam @@ -31,10 +71,10 @@ type _QuotaListRam QuotaListRam // 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 NewQuotaListRam(limit *int64, usage *int64) *QuotaListRam { +func NewQuotaListRam(limit QuotaListRamGetLimitArgType, usage QuotaListRamGetUsageArgType) *QuotaListRam { this := QuotaListRam{} - this.Limit = limit - this.Usage = usage + setQuotaListRamGetLimitAttributeType(&this.Limit, limit) + setQuotaListRamGetUsageAttributeType(&this.Usage, usage) return &this } @@ -47,57 +87,47 @@ func NewQuotaListRamWithDefaults() *QuotaListRam { } // GetLimit returns the Limit field value -func (o *QuotaListRam) GetLimit() *int64 { - if o == nil || IsNil(o.Limit) { - var ret *int64 - return ret - } - - return o.Limit +func (o *QuotaListRam) GetLimit() (ret QuotaListRamGetLimitRetType) { + ret, _ = o.GetLimitOk() + return ret } // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. -func (o *QuotaListRam) GetLimitOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Limit, true +func (o *QuotaListRam) GetLimitOk() (ret QuotaListRamGetLimitRetType, ok bool) { + return getQuotaListRamGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value -func (o *QuotaListRam) SetLimit(v *int64) { - o.Limit = v +func (o *QuotaListRam) SetLimit(v QuotaListRamGetLimitRetType) { + setQuotaListRamGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value -func (o *QuotaListRam) GetUsage() *int64 { - if o == nil || IsNil(o.Usage) { - var ret *int64 - return ret - } - - return o.Usage +func (o *QuotaListRam) GetUsage() (ret QuotaListRamGetUsageRetType) { + ret, _ = o.GetUsageOk() + return ret } // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. -func (o *QuotaListRam) GetUsageOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Usage, true +func (o *QuotaListRam) GetUsageOk() (ret QuotaListRamGetUsageRetType, ok bool) { + return getQuotaListRamGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value -func (o *QuotaListRam) SetUsage(v *int64) { - o.Usage = v +func (o *QuotaListRam) SetUsage(v QuotaListRamGetUsageRetType) { + setQuotaListRamGetUsageAttributeType(&o.Usage, v) } func (o QuotaListRam) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["limit"] = o.Limit - toSerialize["usage"] = o.Usage + if val, ok := getQuotaListRamGetLimitAttributeTypeOk(o.Limit); ok { + toSerialize["Limit"] = val + } + if val, ok := getQuotaListRamGetUsageAttributeTypeOk(o.Usage); ok { + toSerialize["Usage"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_quota_list_response.go b/services/iaas/model_quota_list_response.go index d1b047ff7..80bbd08a9 100644 --- a/services/iaas/model_quota_list_response.go +++ b/services/iaas/model_quota_list_response.go @@ -17,10 +17,30 @@ import ( // checks if the QuotaListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &QuotaListResponse{} +/* + types and functions for quotas +*/ + +// isModel +type QuotaListResponseGetQuotasAttributeType = *QuotaList +type QuotaListResponseGetQuotasArgType = QuotaList +type QuotaListResponseGetQuotasRetType = QuotaList + +func getQuotaListResponseGetQuotasAttributeTypeOk(arg QuotaListResponseGetQuotasAttributeType) (ret QuotaListResponseGetQuotasRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListResponseGetQuotasAttributeType(arg *QuotaListResponseGetQuotasAttributeType, val QuotaListResponseGetQuotasRetType) { + *arg = &val +} + // QuotaListResponse Quotas list response. type QuotaListResponse struct { // REQUIRED - Quotas *QuotaList `json:"quotas"` + Quotas QuotaListResponseGetQuotasAttributeType `json:"quotas"` } type _QuotaListResponse QuotaListResponse @@ -29,9 +49,9 @@ type _QuotaListResponse QuotaListResponse // 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 NewQuotaListResponse(quotas *QuotaList) *QuotaListResponse { +func NewQuotaListResponse(quotas QuotaListResponseGetQuotasArgType) *QuotaListResponse { this := QuotaListResponse{} - this.Quotas = quotas + setQuotaListResponseGetQuotasAttributeType(&this.Quotas, quotas) return &this } @@ -44,32 +64,27 @@ func NewQuotaListResponseWithDefaults() *QuotaListResponse { } // GetQuotas returns the Quotas field value -func (o *QuotaListResponse) GetQuotas() *QuotaList { - if o == nil || IsNil(o.Quotas) { - var ret *QuotaList - return ret - } - - return o.Quotas +func (o *QuotaListResponse) GetQuotas() (ret QuotaListResponseGetQuotasRetType) { + ret, _ = o.GetQuotasOk() + return ret } // GetQuotasOk returns a tuple with the Quotas field value // and a boolean to check if the value has been set. -func (o *QuotaListResponse) GetQuotasOk() (*QuotaList, bool) { - if o == nil { - return nil, false - } - return o.Quotas, true +func (o *QuotaListResponse) GetQuotasOk() (ret QuotaListResponseGetQuotasRetType, ok bool) { + return getQuotaListResponseGetQuotasAttributeTypeOk(o.Quotas) } // SetQuotas sets field value -func (o *QuotaListResponse) SetQuotas(v *QuotaList) { - o.Quotas = v +func (o *QuotaListResponse) SetQuotas(v QuotaListResponseGetQuotasRetType) { + setQuotaListResponseGetQuotasAttributeType(&o.Quotas, v) } func (o QuotaListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["quotas"] = o.Quotas + if val, ok := getQuotaListResponseGetQuotasAttributeTypeOk(o.Quotas); ok { + toSerialize["Quotas"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_quota_list_security_group_rules.go b/services/iaas/model_quota_list_security_group_rules.go index 8cd449de7..af34850e4 100644 --- a/services/iaas/model_quota_list_security_group_rules.go +++ b/services/iaas/model_quota_list_security_group_rules.go @@ -17,12 +17,52 @@ import ( // checks if the QuotaListSecurityGroupRules type satisfies the MappedNullable interface at compile time var _ MappedNullable = &QuotaListSecurityGroupRules{} +/* + types and functions for limit +*/ + +// isLong +type QuotaListSecurityGroupRulesGetLimitAttributeType = *int64 +type QuotaListSecurityGroupRulesGetLimitArgType = int64 +type QuotaListSecurityGroupRulesGetLimitRetType = int64 + +func getQuotaListSecurityGroupRulesGetLimitAttributeTypeOk(arg QuotaListSecurityGroupRulesGetLimitAttributeType) (ret QuotaListSecurityGroupRulesGetLimitRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListSecurityGroupRulesGetLimitAttributeType(arg *QuotaListSecurityGroupRulesGetLimitAttributeType, val QuotaListSecurityGroupRulesGetLimitRetType) { + *arg = &val +} + +/* + types and functions for usage +*/ + +// isLong +type QuotaListSecurityGroupRulesGetUsageAttributeType = *int64 +type QuotaListSecurityGroupRulesGetUsageArgType = int64 +type QuotaListSecurityGroupRulesGetUsageRetType = int64 + +func getQuotaListSecurityGroupRulesGetUsageAttributeTypeOk(arg QuotaListSecurityGroupRulesGetUsageAttributeType) (ret QuotaListSecurityGroupRulesGetUsageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListSecurityGroupRulesGetUsageAttributeType(arg *QuotaListSecurityGroupRulesGetUsageAttributeType, val QuotaListSecurityGroupRulesGetUsageRetType) { + *arg = &val +} + // QuotaListSecurityGroupRules Number of security group rules. type QuotaListSecurityGroupRules struct { // REQUIRED - Limit *int64 `json:"limit"` + Limit QuotaListSecurityGroupRulesGetLimitAttributeType `json:"limit"` // REQUIRED - Usage *int64 `json:"usage"` + Usage QuotaListSecurityGroupRulesGetUsageAttributeType `json:"usage"` } type _QuotaListSecurityGroupRules QuotaListSecurityGroupRules @@ -31,10 +71,10 @@ type _QuotaListSecurityGroupRules QuotaListSecurityGroupRules // 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 NewQuotaListSecurityGroupRules(limit *int64, usage *int64) *QuotaListSecurityGroupRules { +func NewQuotaListSecurityGroupRules(limit QuotaListSecurityGroupRulesGetLimitArgType, usage QuotaListSecurityGroupRulesGetUsageArgType) *QuotaListSecurityGroupRules { this := QuotaListSecurityGroupRules{} - this.Limit = limit - this.Usage = usage + setQuotaListSecurityGroupRulesGetLimitAttributeType(&this.Limit, limit) + setQuotaListSecurityGroupRulesGetUsageAttributeType(&this.Usage, usage) return &this } @@ -47,57 +87,47 @@ func NewQuotaListSecurityGroupRulesWithDefaults() *QuotaListSecurityGroupRules { } // GetLimit returns the Limit field value -func (o *QuotaListSecurityGroupRules) GetLimit() *int64 { - if o == nil || IsNil(o.Limit) { - var ret *int64 - return ret - } - - return o.Limit +func (o *QuotaListSecurityGroupRules) GetLimit() (ret QuotaListSecurityGroupRulesGetLimitRetType) { + ret, _ = o.GetLimitOk() + return ret } // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. -func (o *QuotaListSecurityGroupRules) GetLimitOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Limit, true +func (o *QuotaListSecurityGroupRules) GetLimitOk() (ret QuotaListSecurityGroupRulesGetLimitRetType, ok bool) { + return getQuotaListSecurityGroupRulesGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value -func (o *QuotaListSecurityGroupRules) SetLimit(v *int64) { - o.Limit = v +func (o *QuotaListSecurityGroupRules) SetLimit(v QuotaListSecurityGroupRulesGetLimitRetType) { + setQuotaListSecurityGroupRulesGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value -func (o *QuotaListSecurityGroupRules) GetUsage() *int64 { - if o == nil || IsNil(o.Usage) { - var ret *int64 - return ret - } - - return o.Usage +func (o *QuotaListSecurityGroupRules) GetUsage() (ret QuotaListSecurityGroupRulesGetUsageRetType) { + ret, _ = o.GetUsageOk() + return ret } // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. -func (o *QuotaListSecurityGroupRules) GetUsageOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Usage, true +func (o *QuotaListSecurityGroupRules) GetUsageOk() (ret QuotaListSecurityGroupRulesGetUsageRetType, ok bool) { + return getQuotaListSecurityGroupRulesGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value -func (o *QuotaListSecurityGroupRules) SetUsage(v *int64) { - o.Usage = v +func (o *QuotaListSecurityGroupRules) SetUsage(v QuotaListSecurityGroupRulesGetUsageRetType) { + setQuotaListSecurityGroupRulesGetUsageAttributeType(&o.Usage, v) } func (o QuotaListSecurityGroupRules) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["limit"] = o.Limit - toSerialize["usage"] = o.Usage + if val, ok := getQuotaListSecurityGroupRulesGetLimitAttributeTypeOk(o.Limit); ok { + toSerialize["Limit"] = val + } + if val, ok := getQuotaListSecurityGroupRulesGetUsageAttributeTypeOk(o.Usage); ok { + toSerialize["Usage"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_quota_list_security_groups.go b/services/iaas/model_quota_list_security_groups.go index 19e797399..0db1f02b6 100644 --- a/services/iaas/model_quota_list_security_groups.go +++ b/services/iaas/model_quota_list_security_groups.go @@ -17,12 +17,52 @@ import ( // checks if the QuotaListSecurityGroups type satisfies the MappedNullable interface at compile time var _ MappedNullable = &QuotaListSecurityGroups{} +/* + types and functions for limit +*/ + +// isLong +type QuotaListSecurityGroupsGetLimitAttributeType = *int64 +type QuotaListSecurityGroupsGetLimitArgType = int64 +type QuotaListSecurityGroupsGetLimitRetType = int64 + +func getQuotaListSecurityGroupsGetLimitAttributeTypeOk(arg QuotaListSecurityGroupsGetLimitAttributeType) (ret QuotaListSecurityGroupsGetLimitRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListSecurityGroupsGetLimitAttributeType(arg *QuotaListSecurityGroupsGetLimitAttributeType, val QuotaListSecurityGroupsGetLimitRetType) { + *arg = &val +} + +/* + types and functions for usage +*/ + +// isLong +type QuotaListSecurityGroupsGetUsageAttributeType = *int64 +type QuotaListSecurityGroupsGetUsageArgType = int64 +type QuotaListSecurityGroupsGetUsageRetType = int64 + +func getQuotaListSecurityGroupsGetUsageAttributeTypeOk(arg QuotaListSecurityGroupsGetUsageAttributeType) (ret QuotaListSecurityGroupsGetUsageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListSecurityGroupsGetUsageAttributeType(arg *QuotaListSecurityGroupsGetUsageAttributeType, val QuotaListSecurityGroupsGetUsageRetType) { + *arg = &val +} + // QuotaListSecurityGroups Number of security groups. type QuotaListSecurityGroups struct { // REQUIRED - Limit *int64 `json:"limit"` + Limit QuotaListSecurityGroupsGetLimitAttributeType `json:"limit"` // REQUIRED - Usage *int64 `json:"usage"` + Usage QuotaListSecurityGroupsGetUsageAttributeType `json:"usage"` } type _QuotaListSecurityGroups QuotaListSecurityGroups @@ -31,10 +71,10 @@ type _QuotaListSecurityGroups QuotaListSecurityGroups // 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 NewQuotaListSecurityGroups(limit *int64, usage *int64) *QuotaListSecurityGroups { +func NewQuotaListSecurityGroups(limit QuotaListSecurityGroupsGetLimitArgType, usage QuotaListSecurityGroupsGetUsageArgType) *QuotaListSecurityGroups { this := QuotaListSecurityGroups{} - this.Limit = limit - this.Usage = usage + setQuotaListSecurityGroupsGetLimitAttributeType(&this.Limit, limit) + setQuotaListSecurityGroupsGetUsageAttributeType(&this.Usage, usage) return &this } @@ -47,57 +87,47 @@ func NewQuotaListSecurityGroupsWithDefaults() *QuotaListSecurityGroups { } // GetLimit returns the Limit field value -func (o *QuotaListSecurityGroups) GetLimit() *int64 { - if o == nil || IsNil(o.Limit) { - var ret *int64 - return ret - } - - return o.Limit +func (o *QuotaListSecurityGroups) GetLimit() (ret QuotaListSecurityGroupsGetLimitRetType) { + ret, _ = o.GetLimitOk() + return ret } // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. -func (o *QuotaListSecurityGroups) GetLimitOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Limit, true +func (o *QuotaListSecurityGroups) GetLimitOk() (ret QuotaListSecurityGroupsGetLimitRetType, ok bool) { + return getQuotaListSecurityGroupsGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value -func (o *QuotaListSecurityGroups) SetLimit(v *int64) { - o.Limit = v +func (o *QuotaListSecurityGroups) SetLimit(v QuotaListSecurityGroupsGetLimitRetType) { + setQuotaListSecurityGroupsGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value -func (o *QuotaListSecurityGroups) GetUsage() *int64 { - if o == nil || IsNil(o.Usage) { - var ret *int64 - return ret - } - - return o.Usage +func (o *QuotaListSecurityGroups) GetUsage() (ret QuotaListSecurityGroupsGetUsageRetType) { + ret, _ = o.GetUsageOk() + return ret } // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. -func (o *QuotaListSecurityGroups) GetUsageOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Usage, true +func (o *QuotaListSecurityGroups) GetUsageOk() (ret QuotaListSecurityGroupsGetUsageRetType, ok bool) { + return getQuotaListSecurityGroupsGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value -func (o *QuotaListSecurityGroups) SetUsage(v *int64) { - o.Usage = v +func (o *QuotaListSecurityGroups) SetUsage(v QuotaListSecurityGroupsGetUsageRetType) { + setQuotaListSecurityGroupsGetUsageAttributeType(&o.Usage, v) } func (o QuotaListSecurityGroups) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["limit"] = o.Limit - toSerialize["usage"] = o.Usage + if val, ok := getQuotaListSecurityGroupsGetLimitAttributeTypeOk(o.Limit); ok { + toSerialize["Limit"] = val + } + if val, ok := getQuotaListSecurityGroupsGetUsageAttributeTypeOk(o.Usage); ok { + toSerialize["Usage"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_quota_list_snapshots.go b/services/iaas/model_quota_list_snapshots.go index 00cbab628..ea9e523e0 100644 --- a/services/iaas/model_quota_list_snapshots.go +++ b/services/iaas/model_quota_list_snapshots.go @@ -17,12 +17,52 @@ import ( // checks if the QuotaListSnapshots type satisfies the MappedNullable interface at compile time var _ MappedNullable = &QuotaListSnapshots{} +/* + types and functions for limit +*/ + +// isLong +type QuotaListSnapshotsGetLimitAttributeType = *int64 +type QuotaListSnapshotsGetLimitArgType = int64 +type QuotaListSnapshotsGetLimitRetType = int64 + +func getQuotaListSnapshotsGetLimitAttributeTypeOk(arg QuotaListSnapshotsGetLimitAttributeType) (ret QuotaListSnapshotsGetLimitRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListSnapshotsGetLimitAttributeType(arg *QuotaListSnapshotsGetLimitAttributeType, val QuotaListSnapshotsGetLimitRetType) { + *arg = &val +} + +/* + types and functions for usage +*/ + +// isLong +type QuotaListSnapshotsGetUsageAttributeType = *int64 +type QuotaListSnapshotsGetUsageArgType = int64 +type QuotaListSnapshotsGetUsageRetType = int64 + +func getQuotaListSnapshotsGetUsageAttributeTypeOk(arg QuotaListSnapshotsGetUsageAttributeType) (ret QuotaListSnapshotsGetUsageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListSnapshotsGetUsageAttributeType(arg *QuotaListSnapshotsGetUsageAttributeType, val QuotaListSnapshotsGetUsageRetType) { + *arg = &val +} + // QuotaListSnapshots Number of snapshots. type QuotaListSnapshots struct { // REQUIRED - Limit *int64 `json:"limit"` + Limit QuotaListSnapshotsGetLimitAttributeType `json:"limit"` // REQUIRED - Usage *int64 `json:"usage"` + Usage QuotaListSnapshotsGetUsageAttributeType `json:"usage"` } type _QuotaListSnapshots QuotaListSnapshots @@ -31,10 +71,10 @@ type _QuotaListSnapshots QuotaListSnapshots // 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 NewQuotaListSnapshots(limit *int64, usage *int64) *QuotaListSnapshots { +func NewQuotaListSnapshots(limit QuotaListSnapshotsGetLimitArgType, usage QuotaListSnapshotsGetUsageArgType) *QuotaListSnapshots { this := QuotaListSnapshots{} - this.Limit = limit - this.Usage = usage + setQuotaListSnapshotsGetLimitAttributeType(&this.Limit, limit) + setQuotaListSnapshotsGetUsageAttributeType(&this.Usage, usage) return &this } @@ -47,57 +87,47 @@ func NewQuotaListSnapshotsWithDefaults() *QuotaListSnapshots { } // GetLimit returns the Limit field value -func (o *QuotaListSnapshots) GetLimit() *int64 { - if o == nil || IsNil(o.Limit) { - var ret *int64 - return ret - } - - return o.Limit +func (o *QuotaListSnapshots) GetLimit() (ret QuotaListSnapshotsGetLimitRetType) { + ret, _ = o.GetLimitOk() + return ret } // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. -func (o *QuotaListSnapshots) GetLimitOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Limit, true +func (o *QuotaListSnapshots) GetLimitOk() (ret QuotaListSnapshotsGetLimitRetType, ok bool) { + return getQuotaListSnapshotsGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value -func (o *QuotaListSnapshots) SetLimit(v *int64) { - o.Limit = v +func (o *QuotaListSnapshots) SetLimit(v QuotaListSnapshotsGetLimitRetType) { + setQuotaListSnapshotsGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value -func (o *QuotaListSnapshots) GetUsage() *int64 { - if o == nil || IsNil(o.Usage) { - var ret *int64 - return ret - } - - return o.Usage +func (o *QuotaListSnapshots) GetUsage() (ret QuotaListSnapshotsGetUsageRetType) { + ret, _ = o.GetUsageOk() + return ret } // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. -func (o *QuotaListSnapshots) GetUsageOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Usage, true +func (o *QuotaListSnapshots) GetUsageOk() (ret QuotaListSnapshotsGetUsageRetType, ok bool) { + return getQuotaListSnapshotsGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value -func (o *QuotaListSnapshots) SetUsage(v *int64) { - o.Usage = v +func (o *QuotaListSnapshots) SetUsage(v QuotaListSnapshotsGetUsageRetType) { + setQuotaListSnapshotsGetUsageAttributeType(&o.Usage, v) } func (o QuotaListSnapshots) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["limit"] = o.Limit - toSerialize["usage"] = o.Usage + if val, ok := getQuotaListSnapshotsGetLimitAttributeTypeOk(o.Limit); ok { + toSerialize["Limit"] = val + } + if val, ok := getQuotaListSnapshotsGetUsageAttributeTypeOk(o.Usage); ok { + toSerialize["Usage"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_quota_list_vcpu.go b/services/iaas/model_quota_list_vcpu.go index cec476cdb..0a09b9921 100644 --- a/services/iaas/model_quota_list_vcpu.go +++ b/services/iaas/model_quota_list_vcpu.go @@ -17,12 +17,52 @@ import ( // checks if the QuotaListVcpu type satisfies the MappedNullable interface at compile time var _ MappedNullable = &QuotaListVcpu{} +/* + types and functions for limit +*/ + +// isLong +type QuotaListVcpuGetLimitAttributeType = *int64 +type QuotaListVcpuGetLimitArgType = int64 +type QuotaListVcpuGetLimitRetType = int64 + +func getQuotaListVcpuGetLimitAttributeTypeOk(arg QuotaListVcpuGetLimitAttributeType) (ret QuotaListVcpuGetLimitRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListVcpuGetLimitAttributeType(arg *QuotaListVcpuGetLimitAttributeType, val QuotaListVcpuGetLimitRetType) { + *arg = &val +} + +/* + types and functions for usage +*/ + +// isLong +type QuotaListVcpuGetUsageAttributeType = *int64 +type QuotaListVcpuGetUsageArgType = int64 +type QuotaListVcpuGetUsageRetType = int64 + +func getQuotaListVcpuGetUsageAttributeTypeOk(arg QuotaListVcpuGetUsageAttributeType) (ret QuotaListVcpuGetUsageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListVcpuGetUsageAttributeType(arg *QuotaListVcpuGetUsageAttributeType, val QuotaListVcpuGetUsageRetType) { + *arg = &val +} + // QuotaListVcpu Number of server cores. type QuotaListVcpu struct { // REQUIRED - Limit *int64 `json:"limit"` + Limit QuotaListVcpuGetLimitAttributeType `json:"limit"` // REQUIRED - Usage *int64 `json:"usage"` + Usage QuotaListVcpuGetUsageAttributeType `json:"usage"` } type _QuotaListVcpu QuotaListVcpu @@ -31,10 +71,10 @@ type _QuotaListVcpu QuotaListVcpu // 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 NewQuotaListVcpu(limit *int64, usage *int64) *QuotaListVcpu { +func NewQuotaListVcpu(limit QuotaListVcpuGetLimitArgType, usage QuotaListVcpuGetUsageArgType) *QuotaListVcpu { this := QuotaListVcpu{} - this.Limit = limit - this.Usage = usage + setQuotaListVcpuGetLimitAttributeType(&this.Limit, limit) + setQuotaListVcpuGetUsageAttributeType(&this.Usage, usage) return &this } @@ -47,57 +87,47 @@ func NewQuotaListVcpuWithDefaults() *QuotaListVcpu { } // GetLimit returns the Limit field value -func (o *QuotaListVcpu) GetLimit() *int64 { - if o == nil || IsNil(o.Limit) { - var ret *int64 - return ret - } - - return o.Limit +func (o *QuotaListVcpu) GetLimit() (ret QuotaListVcpuGetLimitRetType) { + ret, _ = o.GetLimitOk() + return ret } // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. -func (o *QuotaListVcpu) GetLimitOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Limit, true +func (o *QuotaListVcpu) GetLimitOk() (ret QuotaListVcpuGetLimitRetType, ok bool) { + return getQuotaListVcpuGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value -func (o *QuotaListVcpu) SetLimit(v *int64) { - o.Limit = v +func (o *QuotaListVcpu) SetLimit(v QuotaListVcpuGetLimitRetType) { + setQuotaListVcpuGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value -func (o *QuotaListVcpu) GetUsage() *int64 { - if o == nil || IsNil(o.Usage) { - var ret *int64 - return ret - } - - return o.Usage +func (o *QuotaListVcpu) GetUsage() (ret QuotaListVcpuGetUsageRetType) { + ret, _ = o.GetUsageOk() + return ret } // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. -func (o *QuotaListVcpu) GetUsageOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Usage, true +func (o *QuotaListVcpu) GetUsageOk() (ret QuotaListVcpuGetUsageRetType, ok bool) { + return getQuotaListVcpuGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value -func (o *QuotaListVcpu) SetUsage(v *int64) { - o.Usage = v +func (o *QuotaListVcpu) SetUsage(v QuotaListVcpuGetUsageRetType) { + setQuotaListVcpuGetUsageAttributeType(&o.Usage, v) } func (o QuotaListVcpu) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["limit"] = o.Limit - toSerialize["usage"] = o.Usage + if val, ok := getQuotaListVcpuGetLimitAttributeTypeOk(o.Limit); ok { + toSerialize["Limit"] = val + } + if val, ok := getQuotaListVcpuGetUsageAttributeTypeOk(o.Usage); ok { + toSerialize["Usage"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_quota_list_volumes.go b/services/iaas/model_quota_list_volumes.go index f4fc99339..a5a384192 100644 --- a/services/iaas/model_quota_list_volumes.go +++ b/services/iaas/model_quota_list_volumes.go @@ -17,12 +17,52 @@ import ( // checks if the QuotaListVolumes type satisfies the MappedNullable interface at compile time var _ MappedNullable = &QuotaListVolumes{} +/* + types and functions for limit +*/ + +// isLong +type QuotaListVolumesGetLimitAttributeType = *int64 +type QuotaListVolumesGetLimitArgType = int64 +type QuotaListVolumesGetLimitRetType = int64 + +func getQuotaListVolumesGetLimitAttributeTypeOk(arg QuotaListVolumesGetLimitAttributeType) (ret QuotaListVolumesGetLimitRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListVolumesGetLimitAttributeType(arg *QuotaListVolumesGetLimitAttributeType, val QuotaListVolumesGetLimitRetType) { + *arg = &val +} + +/* + types and functions for usage +*/ + +// isLong +type QuotaListVolumesGetUsageAttributeType = *int64 +type QuotaListVolumesGetUsageArgType = int64 +type QuotaListVolumesGetUsageRetType = int64 + +func getQuotaListVolumesGetUsageAttributeTypeOk(arg QuotaListVolumesGetUsageAttributeType) (ret QuotaListVolumesGetUsageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setQuotaListVolumesGetUsageAttributeType(arg *QuotaListVolumesGetUsageAttributeType, val QuotaListVolumesGetUsageRetType) { + *arg = &val +} + // QuotaListVolumes Number of volumes. type QuotaListVolumes struct { // REQUIRED - Limit *int64 `json:"limit"` + Limit QuotaListVolumesGetLimitAttributeType `json:"limit"` // REQUIRED - Usage *int64 `json:"usage"` + Usage QuotaListVolumesGetUsageAttributeType `json:"usage"` } type _QuotaListVolumes QuotaListVolumes @@ -31,10 +71,10 @@ type _QuotaListVolumes QuotaListVolumes // 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 NewQuotaListVolumes(limit *int64, usage *int64) *QuotaListVolumes { +func NewQuotaListVolumes(limit QuotaListVolumesGetLimitArgType, usage QuotaListVolumesGetUsageArgType) *QuotaListVolumes { this := QuotaListVolumes{} - this.Limit = limit - this.Usage = usage + setQuotaListVolumesGetLimitAttributeType(&this.Limit, limit) + setQuotaListVolumesGetUsageAttributeType(&this.Usage, usage) return &this } @@ -47,57 +87,47 @@ func NewQuotaListVolumesWithDefaults() *QuotaListVolumes { } // GetLimit returns the Limit field value -func (o *QuotaListVolumes) GetLimit() *int64 { - if o == nil || IsNil(o.Limit) { - var ret *int64 - return ret - } - - return o.Limit +func (o *QuotaListVolumes) GetLimit() (ret QuotaListVolumesGetLimitRetType) { + ret, _ = o.GetLimitOk() + return ret } // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. -func (o *QuotaListVolumes) GetLimitOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Limit, true +func (o *QuotaListVolumes) GetLimitOk() (ret QuotaListVolumesGetLimitRetType, ok bool) { + return getQuotaListVolumesGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value -func (o *QuotaListVolumes) SetLimit(v *int64) { - o.Limit = v +func (o *QuotaListVolumes) SetLimit(v QuotaListVolumesGetLimitRetType) { + setQuotaListVolumesGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value -func (o *QuotaListVolumes) GetUsage() *int64 { - if o == nil || IsNil(o.Usage) { - var ret *int64 - return ret - } - - return o.Usage +func (o *QuotaListVolumes) GetUsage() (ret QuotaListVolumesGetUsageRetType) { + ret, _ = o.GetUsageOk() + return ret } // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. -func (o *QuotaListVolumes) GetUsageOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Usage, true +func (o *QuotaListVolumes) GetUsageOk() (ret QuotaListVolumesGetUsageRetType, ok bool) { + return getQuotaListVolumesGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value -func (o *QuotaListVolumes) SetUsage(v *int64) { - o.Usage = v +func (o *QuotaListVolumes) SetUsage(v QuotaListVolumesGetUsageRetType) { + setQuotaListVolumesGetUsageAttributeType(&o.Usage, v) } func (o QuotaListVolumes) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["limit"] = o.Limit - toSerialize["usage"] = o.Usage + if val, ok := getQuotaListVolumesGetLimitAttributeTypeOk(o.Limit); ok { + toSerialize["Limit"] = val + } + if val, ok := getQuotaListVolumesGetUsageAttributeTypeOk(o.Usage); ok { + toSerialize["Usage"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_request.go b/services/iaas/model_request.go index 842ce74ca..021500fb0 100644 --- a/services/iaas/model_request.go +++ b/services/iaas/model_request.go @@ -17,23 +17,148 @@ import ( // checks if the Request type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Request{} +/* + types and functions for details +*/ + +// isNotNullableString +type RequestGetDetailsAttributeType = *string + +func getRequestGetDetailsAttributeTypeOk(arg RequestGetDetailsAttributeType) (ret RequestGetDetailsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRequestGetDetailsAttributeType(arg *RequestGetDetailsAttributeType, val RequestGetDetailsRetType) { + *arg = &val +} + +type RequestGetDetailsArgType = string +type RequestGetDetailsRetType = string + +/* + types and functions for requestAction +*/ + +// isNotNullableString +type RequestGetRequestActionAttributeType = *string + +func getRequestGetRequestActionAttributeTypeOk(arg RequestGetRequestActionAttributeType) (ret RequestGetRequestActionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRequestGetRequestActionAttributeType(arg *RequestGetRequestActionAttributeType, val RequestGetRequestActionRetType) { + *arg = &val +} + +type RequestGetRequestActionArgType = string +type RequestGetRequestActionRetType = string + +/* + types and functions for requestId +*/ + +// isNotNullableString +type RequestGetRequestIdAttributeType = *string + +func getRequestGetRequestIdAttributeTypeOk(arg RequestGetRequestIdAttributeType) (ret RequestGetRequestIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRequestGetRequestIdAttributeType(arg *RequestGetRequestIdAttributeType, val RequestGetRequestIdRetType) { + *arg = &val +} + +type RequestGetRequestIdArgType = string +type RequestGetRequestIdRetType = string + +/* + types and functions for requestType +*/ + +// isNotNullableString +type RequestGetRequestTypeAttributeType = *string + +func getRequestGetRequestTypeAttributeTypeOk(arg RequestGetRequestTypeAttributeType) (ret RequestGetRequestTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRequestGetRequestTypeAttributeType(arg *RequestGetRequestTypeAttributeType, val RequestGetRequestTypeRetType) { + *arg = &val +} + +type RequestGetRequestTypeArgType = string +type RequestGetRequestTypeRetType = string + +/* + types and functions for resources +*/ + +// isArray +type RequestGetResourcesAttributeType = *[]RequestResource +type RequestGetResourcesArgType = []RequestResource +type RequestGetResourcesRetType = []RequestResource + +func getRequestGetResourcesAttributeTypeOk(arg RequestGetResourcesAttributeType) (ret RequestGetResourcesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRequestGetResourcesAttributeType(arg *RequestGetResourcesAttributeType, val RequestGetResourcesRetType) { + *arg = &val +} + +/* + types and functions for status +*/ + +// isNotNullableString +type RequestGetStatusAttributeType = *string + +func getRequestGetStatusAttributeTypeOk(arg RequestGetStatusAttributeType) (ret RequestGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRequestGetStatusAttributeType(arg *RequestGetStatusAttributeType, val RequestGetStatusRetType) { + *arg = &val +} + +type RequestGetStatusArgType = string +type RequestGetStatusRetType = string + // Request Object that represents a request. type Request struct { - Details *string `json:"details,omitempty"` + Details RequestGetDetailsAttributeType `json:"details,omitempty"` // Object that represents a resource action. Possible values: `CREATE`, `DELETE`, `UPDATE`. // REQUIRED - RequestAction *string `json:"requestAction"` + RequestAction RequestGetRequestActionAttributeType `json:"requestAction"` // Identifier (ID) representing a single API request. // REQUIRED - RequestId *string `json:"requestId"` + RequestId RequestGetRequestIdAttributeType `json:"requestId"` // Object that represents a resource type. Possible values: `BACKUP`, `IMAGE`, `NETWORK`, `NETWORKAREA`, `NIC`, `PROJECT`, `ROUTE`, `SERVER`, `SERVICEACCOUNT`, `SNAPSHOT`, `VIRTUALIP`, `VOLUME`. // REQUIRED - RequestType *string `json:"requestType"` + RequestType RequestGetRequestTypeAttributeType `json:"requestType"` // REQUIRED - Resources *[]RequestResource `json:"resources"` + Resources RequestGetResourcesAttributeType `json:"resources"` // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. // REQUIRED - Status *string `json:"status"` + Status RequestGetStatusAttributeType `json:"status"` } type _Request Request @@ -42,13 +167,13 @@ type _Request Request // 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 NewRequest(requestAction *string, requestId *string, requestType *string, resources *[]RequestResource, status *string) *Request { +func NewRequest(requestAction RequestGetRequestActionArgType, requestId RequestGetRequestIdArgType, requestType RequestGetRequestTypeArgType, resources RequestGetResourcesArgType, status RequestGetStatusArgType) *Request { this := Request{} - this.RequestAction = requestAction - this.RequestId = requestId - this.RequestType = requestType - this.Resources = resources - this.Status = status + setRequestGetRequestActionAttributeType(&this.RequestAction, requestAction) + setRequestGetRequestIdAttributeType(&this.RequestId, requestId) + setRequestGetRequestTypeAttributeType(&this.RequestType, requestType) + setRequestGetResourcesAttributeType(&this.Resources, resources) + setRequestGetStatusAttributeType(&this.Status, status) return &this } @@ -61,167 +186,133 @@ func NewRequestWithDefaults() *Request { } // GetDetails returns the Details field value if set, zero value otherwise. -func (o *Request) GetDetails() *string { - if o == nil || IsNil(o.Details) { - var ret *string - return ret - } - return o.Details +func (o *Request) GetDetails() (res RequestGetDetailsRetType) { + res, _ = o.GetDetailsOk() + return } // GetDetailsOk returns a tuple with the Details field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Request) GetDetailsOk() (*string, bool) { - if o == nil || IsNil(o.Details) { - return nil, false - } - return o.Details, true +func (o *Request) GetDetailsOk() (ret RequestGetDetailsRetType, ok bool) { + return getRequestGetDetailsAttributeTypeOk(o.Details) } // HasDetails returns a boolean if a field has been set. func (o *Request) HasDetails() bool { - if o != nil && !IsNil(o.Details) { - return true - } - - return false + _, ok := o.GetDetailsOk() + return ok } // SetDetails gets a reference to the given string and assigns it to the Details field. -func (o *Request) SetDetails(v *string) { - o.Details = v +func (o *Request) SetDetails(v RequestGetDetailsRetType) { + setRequestGetDetailsAttributeType(&o.Details, v) } // GetRequestAction returns the RequestAction field value -func (o *Request) GetRequestAction() *string { - if o == nil || IsNil(o.RequestAction) { - var ret *string - return ret - } - - return o.RequestAction +func (o *Request) GetRequestAction() (ret RequestGetRequestActionRetType) { + ret, _ = o.GetRequestActionOk() + return ret } // GetRequestActionOk returns a tuple with the RequestAction field value // and a boolean to check if the value has been set. -func (o *Request) GetRequestActionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.RequestAction, true +func (o *Request) GetRequestActionOk() (ret RequestGetRequestActionRetType, ok bool) { + return getRequestGetRequestActionAttributeTypeOk(o.RequestAction) } // SetRequestAction sets field value -func (o *Request) SetRequestAction(v *string) { - o.RequestAction = v +func (o *Request) SetRequestAction(v RequestGetRequestActionRetType) { + setRequestGetRequestActionAttributeType(&o.RequestAction, v) } // GetRequestId returns the RequestId field value -func (o *Request) GetRequestId() *string { - if o == nil || IsNil(o.RequestId) { - var ret *string - return ret - } - - return o.RequestId +func (o *Request) GetRequestId() (ret RequestGetRequestIdRetType) { + ret, _ = o.GetRequestIdOk() + return ret } // GetRequestIdOk returns a tuple with the RequestId field value // and a boolean to check if the value has been set. -func (o *Request) GetRequestIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.RequestId, true +func (o *Request) GetRequestIdOk() (ret RequestGetRequestIdRetType, ok bool) { + return getRequestGetRequestIdAttributeTypeOk(o.RequestId) } // SetRequestId sets field value -func (o *Request) SetRequestId(v *string) { - o.RequestId = v +func (o *Request) SetRequestId(v RequestGetRequestIdRetType) { + setRequestGetRequestIdAttributeType(&o.RequestId, v) } // GetRequestType returns the RequestType field value -func (o *Request) GetRequestType() *string { - if o == nil || IsNil(o.RequestType) { - var ret *string - return ret - } - - return o.RequestType +func (o *Request) GetRequestType() (ret RequestGetRequestTypeRetType) { + ret, _ = o.GetRequestTypeOk() + return ret } // GetRequestTypeOk returns a tuple with the RequestType field value // and a boolean to check if the value has been set. -func (o *Request) GetRequestTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.RequestType, true +func (o *Request) GetRequestTypeOk() (ret RequestGetRequestTypeRetType, ok bool) { + return getRequestGetRequestTypeAttributeTypeOk(o.RequestType) } // SetRequestType sets field value -func (o *Request) SetRequestType(v *string) { - o.RequestType = v +func (o *Request) SetRequestType(v RequestGetRequestTypeRetType) { + setRequestGetRequestTypeAttributeType(&o.RequestType, v) } // GetResources returns the Resources field value -func (o *Request) GetResources() *[]RequestResource { - if o == nil || IsNil(o.Resources) { - var ret *[]RequestResource - return ret - } - - return o.Resources +func (o *Request) GetResources() (ret RequestGetResourcesRetType) { + ret, _ = o.GetResourcesOk() + return ret } // GetResourcesOk returns a tuple with the Resources field value // and a boolean to check if the value has been set. -func (o *Request) GetResourcesOk() (*[]RequestResource, bool) { - if o == nil { - return nil, false - } - return o.Resources, true +func (o *Request) GetResourcesOk() (ret RequestGetResourcesRetType, ok bool) { + return getRequestGetResourcesAttributeTypeOk(o.Resources) } // SetResources sets field value -func (o *Request) SetResources(v *[]RequestResource) { - o.Resources = v +func (o *Request) SetResources(v RequestGetResourcesRetType) { + setRequestGetResourcesAttributeType(&o.Resources, v) } // GetStatus returns the Status field value -func (o *Request) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - - return o.Status +func (o *Request) GetStatus() (ret RequestGetStatusRetType) { + ret, _ = o.GetStatusOk() + return ret } // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *Request) GetStatusOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Status, true +func (o *Request) GetStatusOk() (ret RequestGetStatusRetType, ok bool) { + return getRequestGetStatusAttributeTypeOk(o.Status) } // SetStatus sets field value -func (o *Request) SetStatus(v *string) { - o.Status = v +func (o *Request) SetStatus(v RequestGetStatusRetType) { + setRequestGetStatusAttributeType(&o.Status, v) } func (o Request) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Details) { - toSerialize["details"] = o.Details + if val, ok := getRequestGetDetailsAttributeTypeOk(o.Details); ok { + toSerialize["Details"] = val + } + if val, ok := getRequestGetRequestActionAttributeTypeOk(o.RequestAction); ok { + toSerialize["RequestAction"] = val + } + if val, ok := getRequestGetRequestIdAttributeTypeOk(o.RequestId); ok { + toSerialize["RequestId"] = val + } + if val, ok := getRequestGetRequestTypeAttributeTypeOk(o.RequestType); ok { + toSerialize["RequestType"] = val + } + if val, ok := getRequestGetResourcesAttributeTypeOk(o.Resources); ok { + toSerialize["Resources"] = val + } + if val, ok := getRequestGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } - toSerialize["requestAction"] = o.RequestAction - toSerialize["requestId"] = o.RequestId - toSerialize["requestType"] = o.RequestType - toSerialize["resources"] = o.Resources - toSerialize["status"] = o.Status return toSerialize, nil } diff --git a/services/iaas/model_request_resource.go b/services/iaas/model_request_resource.go index dec67bad3..117854a5f 100644 --- a/services/iaas/model_request_resource.go +++ b/services/iaas/model_request_resource.go @@ -17,17 +17,80 @@ import ( // checks if the RequestResource type satisfies the MappedNullable interface at compile time var _ MappedNullable = &RequestResource{} +/* + types and functions for id +*/ + +// isNotNullableString +type RequestResourceGetIdAttributeType = *string + +func getRequestResourceGetIdAttributeTypeOk(arg RequestResourceGetIdAttributeType) (ret RequestResourceGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRequestResourceGetIdAttributeType(arg *RequestResourceGetIdAttributeType, val RequestResourceGetIdRetType) { + *arg = &val +} + +type RequestResourceGetIdArgType = string +type RequestResourceGetIdRetType = string + +/* + types and functions for status +*/ + +// isNotNullableString +type RequestResourceGetStatusAttributeType = *string + +func getRequestResourceGetStatusAttributeTypeOk(arg RequestResourceGetStatusAttributeType) (ret RequestResourceGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRequestResourceGetStatusAttributeType(arg *RequestResourceGetStatusAttributeType, val RequestResourceGetStatusRetType) { + *arg = &val +} + +type RequestResourceGetStatusArgType = string +type RequestResourceGetStatusRetType = string + +/* + types and functions for type +*/ + +// isNotNullableString +type RequestResourceGetTypeAttributeType = *string + +func getRequestResourceGetTypeAttributeTypeOk(arg RequestResourceGetTypeAttributeType) (ret RequestResourceGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRequestResourceGetTypeAttributeType(arg *RequestResourceGetTypeAttributeType, val RequestResourceGetTypeRetType) { + *arg = &val +} + +type RequestResourceGetTypeArgType = string +type RequestResourceGetTypeRetType = string + // RequestResource Object that represents a resource as part of a request. type RequestResource struct { // Universally Unique Identifier (UUID). // REQUIRED - Id *string `json:"id"` + Id RequestResourceGetIdAttributeType `json:"id"` // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. // REQUIRED - Status *string `json:"status"` + Status RequestResourceGetStatusAttributeType `json:"status"` // Object that represents a resource type. Possible values: `BACKUP`, `IMAGE`, `NETWORK`, `NETWORKAREA`, `NIC`, `PROJECT`, `ROUTE`, `SERVER`, `SERVICEACCOUNT`, `SNAPSHOT`, `VIRTUALIP`, `VOLUME`. // REQUIRED - Type *string `json:"type"` + Type RequestResourceGetTypeAttributeType `json:"type"` } type _RequestResource RequestResource @@ -36,11 +99,11 @@ type _RequestResource RequestResource // 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 NewRequestResource(id *string, status *string, type_ *string) *RequestResource { +func NewRequestResource(id RequestResourceGetIdArgType, status RequestResourceGetStatusArgType, type_ RequestResourceGetTypeArgType) *RequestResource { this := RequestResource{} - this.Id = id - this.Status = status - this.Type = type_ + setRequestResourceGetIdAttributeType(&this.Id, id) + setRequestResourceGetStatusAttributeType(&this.Status, status) + setRequestResourceGetTypeAttributeType(&this.Type, type_) return &this } @@ -53,82 +116,67 @@ func NewRequestResourceWithDefaults() *RequestResource { } // GetId returns the Id field value -func (o *RequestResource) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - - return o.Id +func (o *RequestResource) GetId() (ret RequestResourceGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *RequestResource) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *RequestResource) GetIdOk() (ret RequestResourceGetIdRetType, ok bool) { + return getRequestResourceGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *RequestResource) SetId(v *string) { - o.Id = v +func (o *RequestResource) SetId(v RequestResourceGetIdRetType) { + setRequestResourceGetIdAttributeType(&o.Id, v) } // GetStatus returns the Status field value -func (o *RequestResource) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - - return o.Status +func (o *RequestResource) GetStatus() (ret RequestResourceGetStatusRetType) { + ret, _ = o.GetStatusOk() + return ret } // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *RequestResource) GetStatusOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Status, true +func (o *RequestResource) GetStatusOk() (ret RequestResourceGetStatusRetType, ok bool) { + return getRequestResourceGetStatusAttributeTypeOk(o.Status) } // SetStatus sets field value -func (o *RequestResource) SetStatus(v *string) { - o.Status = v +func (o *RequestResource) SetStatus(v RequestResourceGetStatusRetType) { + setRequestResourceGetStatusAttributeType(&o.Status, v) } // GetType returns the Type field value -func (o *RequestResource) GetType() *string { - if o == nil || IsNil(o.Type) { - var ret *string - return ret - } - - return o.Type +func (o *RequestResource) GetType() (ret RequestResourceGetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret } // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *RequestResource) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Type, true +func (o *RequestResource) GetTypeOk() (ret RequestResourceGetTypeRetType, ok bool) { + return getRequestResourceGetTypeAttributeTypeOk(o.Type) } // SetType sets field value -func (o *RequestResource) SetType(v *string) { - o.Type = v +func (o *RequestResource) SetType(v RequestResourceGetTypeRetType) { + setRequestResourceGetTypeAttributeType(&o.Type, v) } func (o RequestResource) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["status"] = o.Status - toSerialize["type"] = o.Type + if val, ok := getRequestResourceGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getRequestResourceGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val + } + if val, ok := getRequestResourceGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_rescue_server_payload.go b/services/iaas/model_rescue_server_payload.go index fdf3ce392..907af4415 100644 --- a/services/iaas/model_rescue_server_payload.go +++ b/services/iaas/model_rescue_server_payload.go @@ -17,11 +17,32 @@ import ( // checks if the RescueServerPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &RescueServerPayload{} +/* + types and functions for image +*/ + +// isNotNullableString +type RescueServerPayloadGetImageAttributeType = *string + +func getRescueServerPayloadGetImageAttributeTypeOk(arg RescueServerPayloadGetImageAttributeType) (ret RescueServerPayloadGetImageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRescueServerPayloadGetImageAttributeType(arg *RescueServerPayloadGetImageAttributeType, val RescueServerPayloadGetImageRetType) { + *arg = &val +} + +type RescueServerPayloadGetImageArgType = string +type RescueServerPayloadGetImageRetType = string + // RescueServerPayload struct for RescueServerPayload type RescueServerPayload struct { // Universally Unique Identifier (UUID). // REQUIRED - Image *string `json:"image"` + Image RescueServerPayloadGetImageAttributeType `json:"image"` } type _RescueServerPayload RescueServerPayload @@ -30,9 +51,9 @@ type _RescueServerPayload RescueServerPayload // 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 NewRescueServerPayload(image *string) *RescueServerPayload { +func NewRescueServerPayload(image RescueServerPayloadGetImageArgType) *RescueServerPayload { this := RescueServerPayload{} - this.Image = image + setRescueServerPayloadGetImageAttributeType(&this.Image, image) return &this } @@ -45,32 +66,27 @@ func NewRescueServerPayloadWithDefaults() *RescueServerPayload { } // GetImage returns the Image field value -func (o *RescueServerPayload) GetImage() *string { - if o == nil || IsNil(o.Image) { - var ret *string - return ret - } - - return o.Image +func (o *RescueServerPayload) GetImage() (ret RescueServerPayloadGetImageRetType) { + ret, _ = o.GetImageOk() + return ret } // GetImageOk returns a tuple with the Image field value // and a boolean to check if the value has been set. -func (o *RescueServerPayload) GetImageOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Image, true +func (o *RescueServerPayload) GetImageOk() (ret RescueServerPayloadGetImageRetType, ok bool) { + return getRescueServerPayloadGetImageAttributeTypeOk(o.Image) } // SetImage sets field value -func (o *RescueServerPayload) SetImage(v *string) { - o.Image = v +func (o *RescueServerPayload) SetImage(v RescueServerPayloadGetImageRetType) { + setRescueServerPayloadGetImageAttributeType(&o.Image, v) } func (o RescueServerPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["image"] = o.Image + if val, ok := getRescueServerPayloadGetImageAttributeTypeOk(o.Image); ok { + toSerialize["Image"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_resize_server_payload.go b/services/iaas/model_resize_server_payload.go index d89275bc1..3592a31f8 100644 --- a/services/iaas/model_resize_server_payload.go +++ b/services/iaas/model_resize_server_payload.go @@ -17,11 +17,32 @@ import ( // checks if the ResizeServerPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ResizeServerPayload{} +/* + types and functions for machineType +*/ + +// isNotNullableString +type ResizeServerPayloadGetMachineTypeAttributeType = *string + +func getResizeServerPayloadGetMachineTypeAttributeTypeOk(arg ResizeServerPayloadGetMachineTypeAttributeType) (ret ResizeServerPayloadGetMachineTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResizeServerPayloadGetMachineTypeAttributeType(arg *ResizeServerPayloadGetMachineTypeAttributeType, val ResizeServerPayloadGetMachineTypeRetType) { + *arg = &val +} + +type ResizeServerPayloadGetMachineTypeArgType = string +type ResizeServerPayloadGetMachineTypeRetType = string + // ResizeServerPayload struct for ResizeServerPayload type ResizeServerPayload struct { // The name for a General Object. Matches Names and also UUIDs. // REQUIRED - MachineType *string `json:"machineType"` + MachineType ResizeServerPayloadGetMachineTypeAttributeType `json:"machineType"` } type _ResizeServerPayload ResizeServerPayload @@ -30,9 +51,9 @@ type _ResizeServerPayload ResizeServerPayload // 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 NewResizeServerPayload(machineType *string) *ResizeServerPayload { +func NewResizeServerPayload(machineType ResizeServerPayloadGetMachineTypeArgType) *ResizeServerPayload { this := ResizeServerPayload{} - this.MachineType = machineType + setResizeServerPayloadGetMachineTypeAttributeType(&this.MachineType, machineType) return &this } @@ -45,32 +66,27 @@ func NewResizeServerPayloadWithDefaults() *ResizeServerPayload { } // GetMachineType returns the MachineType field value -func (o *ResizeServerPayload) GetMachineType() *string { - if o == nil || IsNil(o.MachineType) { - var ret *string - return ret - } - - return o.MachineType +func (o *ResizeServerPayload) GetMachineType() (ret ResizeServerPayloadGetMachineTypeRetType) { + ret, _ = o.GetMachineTypeOk() + return ret } // GetMachineTypeOk returns a tuple with the MachineType field value // and a boolean to check if the value has been set. -func (o *ResizeServerPayload) GetMachineTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.MachineType, true +func (o *ResizeServerPayload) GetMachineTypeOk() (ret ResizeServerPayloadGetMachineTypeRetType, ok bool) { + return getResizeServerPayloadGetMachineTypeAttributeTypeOk(o.MachineType) } // SetMachineType sets field value -func (o *ResizeServerPayload) SetMachineType(v *string) { - o.MachineType = v +func (o *ResizeServerPayload) SetMachineType(v ResizeServerPayloadGetMachineTypeRetType) { + setResizeServerPayloadGetMachineTypeAttributeType(&o.MachineType, v) } func (o ResizeServerPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["machineType"] = o.MachineType + if val, ok := getResizeServerPayloadGetMachineTypeAttributeTypeOk(o.MachineType); ok { + toSerialize["MachineType"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_resize_volume_payload.go b/services/iaas/model_resize_volume_payload.go index 8863bc87f..c6d4c1068 100644 --- a/services/iaas/model_resize_volume_payload.go +++ b/services/iaas/model_resize_volume_payload.go @@ -17,11 +17,31 @@ import ( // checks if the ResizeVolumePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ResizeVolumePayload{} +/* + types and functions for size +*/ + +// isLong +type ResizeVolumePayloadGetSizeAttributeType = *int64 +type ResizeVolumePayloadGetSizeArgType = int64 +type ResizeVolumePayloadGetSizeRetType = int64 + +func getResizeVolumePayloadGetSizeAttributeTypeOk(arg ResizeVolumePayloadGetSizeAttributeType) (ret ResizeVolumePayloadGetSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setResizeVolumePayloadGetSizeAttributeType(arg *ResizeVolumePayloadGetSizeAttributeType, val ResizeVolumePayloadGetSizeRetType) { + *arg = &val +} + // ResizeVolumePayload struct for ResizeVolumePayload type ResizeVolumePayload struct { // Size in Gigabyte. // REQUIRED - Size *int64 `json:"size"` + Size ResizeVolumePayloadGetSizeAttributeType `json:"size"` } type _ResizeVolumePayload ResizeVolumePayload @@ -30,9 +50,9 @@ type _ResizeVolumePayload ResizeVolumePayload // 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 NewResizeVolumePayload(size *int64) *ResizeVolumePayload { +func NewResizeVolumePayload(size ResizeVolumePayloadGetSizeArgType) *ResizeVolumePayload { this := ResizeVolumePayload{} - this.Size = size + setResizeVolumePayloadGetSizeAttributeType(&this.Size, size) return &this } @@ -45,32 +65,27 @@ func NewResizeVolumePayloadWithDefaults() *ResizeVolumePayload { } // GetSize returns the Size field value -func (o *ResizeVolumePayload) GetSize() *int64 { - if o == nil || IsNil(o.Size) { - var ret *int64 - return ret - } - - return o.Size +func (o *ResizeVolumePayload) GetSize() (ret ResizeVolumePayloadGetSizeRetType) { + ret, _ = o.GetSizeOk() + return ret } // GetSizeOk returns a tuple with the Size field value // and a boolean to check if the value has been set. -func (o *ResizeVolumePayload) GetSizeOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Size, true +func (o *ResizeVolumePayload) GetSizeOk() (ret ResizeVolumePayloadGetSizeRetType, ok bool) { + return getResizeVolumePayloadGetSizeAttributeTypeOk(o.Size) } // SetSize sets field value -func (o *ResizeVolumePayload) SetSize(v *int64) { - o.Size = v +func (o *ResizeVolumePayload) SetSize(v ResizeVolumePayloadGetSizeRetType) { + setResizeVolumePayloadGetSizeAttributeType(&o.Size, v) } func (o ResizeVolumePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["size"] = o.Size + if val, ok := getResizeVolumePayloadGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_route.go b/services/iaas/model_route.go index 5fac5152c..b34e8cb81 100644 --- a/services/iaas/model_route.go +++ b/services/iaas/model_route.go @@ -18,22 +18,145 @@ import ( // checks if the Route type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Route{} +/* + types and functions for createdAt +*/ + +// isDateTime +type RouteGetCreatedAtAttributeType = *time.Time +type RouteGetCreatedAtArgType = time.Time +type RouteGetCreatedAtRetType = time.Time + +func getRouteGetCreatedAtAttributeTypeOk(arg RouteGetCreatedAtAttributeType) (ret RouteGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRouteGetCreatedAtAttributeType(arg *RouteGetCreatedAtAttributeType, val RouteGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isFreeform +type RouteGetLabelsAttributeType = *map[string]interface{} +type RouteGetLabelsArgType = map[string]interface{} +type RouteGetLabelsRetType = map[string]interface{} + +func getRouteGetLabelsAttributeTypeOk(arg RouteGetLabelsAttributeType) (ret RouteGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRouteGetLabelsAttributeType(arg *RouteGetLabelsAttributeType, val RouteGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for nexthop +*/ + +// isNotNullableString +type RouteGetNexthopAttributeType = *string + +func getRouteGetNexthopAttributeTypeOk(arg RouteGetNexthopAttributeType) (ret RouteGetNexthopRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRouteGetNexthopAttributeType(arg *RouteGetNexthopAttributeType, val RouteGetNexthopRetType) { + *arg = &val +} + +type RouteGetNexthopArgType = string +type RouteGetNexthopRetType = string + +/* + types and functions for prefix +*/ + +// isNotNullableString +type RouteGetPrefixAttributeType = *string + +func getRouteGetPrefixAttributeTypeOk(arg RouteGetPrefixAttributeType) (ret RouteGetPrefixRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRouteGetPrefixAttributeType(arg *RouteGetPrefixAttributeType, val RouteGetPrefixRetType) { + *arg = &val +} + +type RouteGetPrefixArgType = string +type RouteGetPrefixRetType = string + +/* + types and functions for routeId +*/ + +// isNotNullableString +type RouteGetRouteIdAttributeType = *string + +func getRouteGetRouteIdAttributeTypeOk(arg RouteGetRouteIdAttributeType) (ret RouteGetRouteIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRouteGetRouteIdAttributeType(arg *RouteGetRouteIdAttributeType, val RouteGetRouteIdRetType) { + *arg = &val +} + +type RouteGetRouteIdArgType = string +type RouteGetRouteIdRetType = string + +/* + types and functions for updatedAt +*/ + +// isDateTime +type RouteGetUpdatedAtAttributeType = *time.Time +type RouteGetUpdatedAtArgType = time.Time +type RouteGetUpdatedAtRetType = time.Time + +func getRouteGetUpdatedAtAttributeTypeOk(arg RouteGetUpdatedAtAttributeType) (ret RouteGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRouteGetUpdatedAtAttributeType(arg *RouteGetUpdatedAtAttributeType, val RouteGetUpdatedAtRetType) { + *arg = &val +} + // Route Object represents a network route. type Route struct { // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt RouteGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels RouteGetLabelsAttributeType `json:"labels,omitempty"` // Object that represents an IP address. // REQUIRED - Nexthop *string `json:"nexthop"` + Nexthop RouteGetNexthopAttributeType `json:"nexthop"` // Classless Inter-Domain Routing (CIDR). // REQUIRED - Prefix *string `json:"prefix"` + Prefix RouteGetPrefixAttributeType `json:"prefix"` // Universally Unique Identifier (UUID). - RouteId *string `json:"routeId,omitempty"` + RouteId RouteGetRouteIdAttributeType `json:"routeId,omitempty"` // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAt RouteGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } type _Route Route @@ -42,10 +165,10 @@ type _Route Route // 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 NewRoute(nexthop *string, prefix *string) *Route { +func NewRoute(nexthop RouteGetNexthopArgType, prefix RouteGetPrefixArgType) *Route { this := Route{} - this.Nexthop = nexthop - this.Prefix = prefix + setRouteGetNexthopAttributeType(&this.Nexthop, nexthop) + setRouteGetPrefixAttributeType(&this.Prefix, prefix) return &this } @@ -58,196 +181,150 @@ func NewRouteWithDefaults() *Route { } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *Route) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - return o.CreatedAt +func (o *Route) GetCreatedAt() (res RouteGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return } // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Route) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true +func (o *Route) GetCreatedAtOk() (ret RouteGetCreatedAtRetType, ok bool) { + return getRouteGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. func (o *Route) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false + _, ok := o.GetCreatedAtOk() + return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *Route) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *Route) SetCreatedAt(v RouteGetCreatedAtRetType) { + setRouteGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *Route) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *Route) GetLabels() (res RouteGetLabelsRetType) { + 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 *Route) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *Route) GetLabelsOk() (ret RouteGetLabelsRetType, ok bool) { + return getRouteGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *Route) 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 *Route) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *Route) SetLabels(v RouteGetLabelsRetType) { + setRouteGetLabelsAttributeType(&o.Labels, v) } // GetNexthop returns the Nexthop field value -func (o *Route) GetNexthop() *string { - if o == nil || IsNil(o.Nexthop) { - var ret *string - return ret - } - - return o.Nexthop +func (o *Route) GetNexthop() (ret RouteGetNexthopRetType) { + ret, _ = o.GetNexthopOk() + return ret } // GetNexthopOk returns a tuple with the Nexthop field value // and a boolean to check if the value has been set. -func (o *Route) GetNexthopOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Nexthop, true +func (o *Route) GetNexthopOk() (ret RouteGetNexthopRetType, ok bool) { + return getRouteGetNexthopAttributeTypeOk(o.Nexthop) } // SetNexthop sets field value -func (o *Route) SetNexthop(v *string) { - o.Nexthop = v +func (o *Route) SetNexthop(v RouteGetNexthopRetType) { + setRouteGetNexthopAttributeType(&o.Nexthop, v) } // GetPrefix returns the Prefix field value -func (o *Route) GetPrefix() *string { - if o == nil || IsNil(o.Prefix) { - var ret *string - return ret - } - - return o.Prefix +func (o *Route) GetPrefix() (ret RouteGetPrefixRetType) { + ret, _ = o.GetPrefixOk() + return ret } // GetPrefixOk returns a tuple with the Prefix field value // and a boolean to check if the value has been set. -func (o *Route) GetPrefixOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Prefix, true +func (o *Route) GetPrefixOk() (ret RouteGetPrefixRetType, ok bool) { + return getRouteGetPrefixAttributeTypeOk(o.Prefix) } // SetPrefix sets field value -func (o *Route) SetPrefix(v *string) { - o.Prefix = v +func (o *Route) SetPrefix(v RouteGetPrefixRetType) { + setRouteGetPrefixAttributeType(&o.Prefix, v) } // GetRouteId returns the RouteId field value if set, zero value otherwise. -func (o *Route) GetRouteId() *string { - if o == nil || IsNil(o.RouteId) { - var ret *string - return ret - } - return o.RouteId +func (o *Route) GetRouteId() (res RouteGetRouteIdRetType) { + res, _ = o.GetRouteIdOk() + return } // GetRouteIdOk returns a tuple with the RouteId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Route) GetRouteIdOk() (*string, bool) { - if o == nil || IsNil(o.RouteId) { - return nil, false - } - return o.RouteId, true +func (o *Route) GetRouteIdOk() (ret RouteGetRouteIdRetType, ok bool) { + return getRouteGetRouteIdAttributeTypeOk(o.RouteId) } // HasRouteId returns a boolean if a field has been set. func (o *Route) HasRouteId() bool { - if o != nil && !IsNil(o.RouteId) { - return true - } - - return false + _, ok := o.GetRouteIdOk() + return ok } // SetRouteId gets a reference to the given string and assigns it to the RouteId field. -func (o *Route) SetRouteId(v *string) { - o.RouteId = v +func (o *Route) SetRouteId(v RouteGetRouteIdRetType) { + setRouteGetRouteIdAttributeType(&o.RouteId, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *Route) GetUpdatedAt() *time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret *time.Time - return ret - } - return o.UpdatedAt +func (o *Route) GetUpdatedAt() (res RouteGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Route) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true +func (o *Route) GetUpdatedAtOk() (ret RouteGetUpdatedAtRetType, ok bool) { + return getRouteGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. func (o *Route) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false + _, ok := o.GetUpdatedAtOk() + return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *Route) SetUpdatedAt(v *time.Time) { - o.UpdatedAt = v +func (o *Route) SetUpdatedAt(v RouteGetUpdatedAtRetType) { + setRouteGetUpdatedAtAttributeType(&o.UpdatedAt, v) } func (o Route) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt + if val, ok := getRouteGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getRouteGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getRouteGetNexthopAttributeTypeOk(o.Nexthop); ok { + toSerialize["Nexthop"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getRouteGetPrefixAttributeTypeOk(o.Prefix); ok { + toSerialize["Prefix"] = val } - toSerialize["nexthop"] = o.Nexthop - toSerialize["prefix"] = o.Prefix - if !IsNil(o.RouteId) { - toSerialize["routeId"] = o.RouteId + if val, ok := getRouteGetRouteIdAttributeTypeOk(o.RouteId); ok { + toSerialize["RouteId"] = val } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt + if val, ok := getRouteGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val } return toSerialize, nil } diff --git a/services/iaas/model_route_list_response.go b/services/iaas/model_route_list_response.go index 705765b9b..619b41614 100644 --- a/services/iaas/model_route_list_response.go +++ b/services/iaas/model_route_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the RouteListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &RouteListResponse{} +/* + types and functions for items +*/ + +// isArray +type RouteListResponseGetItemsAttributeType = *[]Route +type RouteListResponseGetItemsArgType = []Route +type RouteListResponseGetItemsRetType = []Route + +func getRouteListResponseGetItemsAttributeTypeOk(arg RouteListResponseGetItemsAttributeType) (ret RouteListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRouteListResponseGetItemsAttributeType(arg *RouteListResponseGetItemsAttributeType, val RouteListResponseGetItemsRetType) { + *arg = &val +} + // RouteListResponse Route list response. type RouteListResponse struct { // A list of routes. // REQUIRED - Items *[]Route `json:"items"` + Items RouteListResponseGetItemsAttributeType `json:"items"` } type _RouteListResponse RouteListResponse @@ -30,9 +50,9 @@ type _RouteListResponse RouteListResponse // 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 NewRouteListResponse(items *[]Route) *RouteListResponse { +func NewRouteListResponse(items RouteListResponseGetItemsArgType) *RouteListResponse { this := RouteListResponse{} - this.Items = items + setRouteListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewRouteListResponseWithDefaults() *RouteListResponse { } // GetItems returns the Items field value -func (o *RouteListResponse) GetItems() *[]Route { - if o == nil || IsNil(o.Items) { - var ret *[]Route - return ret - } - - return o.Items +func (o *RouteListResponse) GetItems() (ret RouteListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *RouteListResponse) GetItemsOk() (*[]Route, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *RouteListResponse) GetItemsOk() (ret RouteListResponseGetItemsRetType, ok bool) { + return getRouteListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *RouteListResponse) SetItems(v *[]Route) { - o.Items = v +func (o *RouteListResponse) SetItems(v RouteListResponseGetItemsRetType) { + setRouteListResponseGetItemsAttributeType(&o.Items, v) } func (o RouteListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getRouteListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_security_group.go b/services/iaas/model_security_group.go index 92db9f2ee..8a0ba7127 100644 --- a/services/iaas/model_security_group.go +++ b/services/iaas/model_security_group.go @@ -18,25 +18,188 @@ import ( // checks if the SecurityGroup type satisfies the MappedNullable interface at compile time var _ MappedNullable = &SecurityGroup{} +/* + types and functions for createdAt +*/ + +// isDateTime +type SecurityGroupGetCreatedAtAttributeType = *time.Time +type SecurityGroupGetCreatedAtArgType = time.Time +type SecurityGroupGetCreatedAtRetType = time.Time + +func getSecurityGroupGetCreatedAtAttributeTypeOk(arg SecurityGroupGetCreatedAtAttributeType) (ret SecurityGroupGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupGetCreatedAtAttributeType(arg *SecurityGroupGetCreatedAtAttributeType, val SecurityGroupGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for description +*/ + +// isNotNullableString +type SecurityGroupGetDescriptionAttributeType = *string + +func getSecurityGroupGetDescriptionAttributeTypeOk(arg SecurityGroupGetDescriptionAttributeType) (ret SecurityGroupGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupGetDescriptionAttributeType(arg *SecurityGroupGetDescriptionAttributeType, val SecurityGroupGetDescriptionRetType) { + *arg = &val +} + +type SecurityGroupGetDescriptionArgType = string +type SecurityGroupGetDescriptionRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type SecurityGroupGetIdAttributeType = *string + +func getSecurityGroupGetIdAttributeTypeOk(arg SecurityGroupGetIdAttributeType) (ret SecurityGroupGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupGetIdAttributeType(arg *SecurityGroupGetIdAttributeType, val SecurityGroupGetIdRetType) { + *arg = &val +} + +type SecurityGroupGetIdArgType = string +type SecurityGroupGetIdRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type SecurityGroupGetLabelsAttributeType = *map[string]interface{} +type SecurityGroupGetLabelsArgType = map[string]interface{} +type SecurityGroupGetLabelsRetType = map[string]interface{} + +func getSecurityGroupGetLabelsAttributeTypeOk(arg SecurityGroupGetLabelsAttributeType) (ret SecurityGroupGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupGetLabelsAttributeType(arg *SecurityGroupGetLabelsAttributeType, val SecurityGroupGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type SecurityGroupGetNameAttributeType = *string + +func getSecurityGroupGetNameAttributeTypeOk(arg SecurityGroupGetNameAttributeType) (ret SecurityGroupGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupGetNameAttributeType(arg *SecurityGroupGetNameAttributeType, val SecurityGroupGetNameRetType) { + *arg = &val +} + +type SecurityGroupGetNameArgType = string +type SecurityGroupGetNameRetType = string + +/* + types and functions for rules +*/ + +// isArray +type SecurityGroupGetRulesAttributeType = *[]SecurityGroupRule +type SecurityGroupGetRulesArgType = []SecurityGroupRule +type SecurityGroupGetRulesRetType = []SecurityGroupRule + +func getSecurityGroupGetRulesAttributeTypeOk(arg SecurityGroupGetRulesAttributeType) (ret SecurityGroupGetRulesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupGetRulesAttributeType(arg *SecurityGroupGetRulesAttributeType, val SecurityGroupGetRulesRetType) { + *arg = &val +} + +/* + types and functions for stateful +*/ + +// isBoolean +type SecurityGroupgetStatefulAttributeType = *bool +type SecurityGroupgetStatefulArgType = bool +type SecurityGroupgetStatefulRetType = bool + +func getSecurityGroupgetStatefulAttributeTypeOk(arg SecurityGroupgetStatefulAttributeType) (ret SecurityGroupgetStatefulRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupgetStatefulAttributeType(arg *SecurityGroupgetStatefulAttributeType, val SecurityGroupgetStatefulRetType) { + *arg = &val +} + +/* + types and functions for updatedAt +*/ + +// isDateTime +type SecurityGroupGetUpdatedAtAttributeType = *time.Time +type SecurityGroupGetUpdatedAtArgType = time.Time +type SecurityGroupGetUpdatedAtRetType = time.Time + +func getSecurityGroupGetUpdatedAtAttributeTypeOk(arg SecurityGroupGetUpdatedAtAttributeType) (ret SecurityGroupGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupGetUpdatedAtAttributeType(arg *SecurityGroupGetUpdatedAtAttributeType, val SecurityGroupGetUpdatedAtRetType) { + *arg = &val +} + // SecurityGroup Object that represents a security group. type SecurityGroup struct { // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt SecurityGroupGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Description Object. Allows string up to 127 Characters. - Description *string `json:"description,omitempty"` + Description SecurityGroupGetDescriptionAttributeType `json:"description,omitempty"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id SecurityGroupGetIdAttributeType `json:"id,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels SecurityGroupGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED - Name *string `json:"name"` + Name SecurityGroupGetNameAttributeType `json:"name"` // A list containing security group rule objects. - Rules *[]SecurityGroupRule `json:"rules,omitempty"` + Rules SecurityGroupGetRulesAttributeType `json:"rules,omitempty"` // Shows if a security group is stateful or stateless. You can only have one type of security groups per network interface/server. - Stateful *bool `json:"stateful,omitempty"` + Stateful SecurityGroupgetStatefulAttributeType `json:"stateful,omitempty"` // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAt SecurityGroupGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } type _SecurityGroup SecurityGroup @@ -45,11 +208,9 @@ type _SecurityGroup SecurityGroup // 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 NewSecurityGroup(name *string) *SecurityGroup { +func NewSecurityGroup(name SecurityGroupGetNameArgType) *SecurityGroup { this := SecurityGroup{} - this.Name = name - var stateful bool = true - this.Stateful = &stateful + setSecurityGroupGetNameAttributeType(&this.Name, name) return &this } @@ -64,276 +225,208 @@ func NewSecurityGroupWithDefaults() *SecurityGroup { } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *SecurityGroup) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - return o.CreatedAt +func (o *SecurityGroup) GetCreatedAt() (res SecurityGroupGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return } // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SecurityGroup) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true +func (o *SecurityGroup) GetCreatedAtOk() (ret SecurityGroupGetCreatedAtRetType, ok bool) { + return getSecurityGroupGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. func (o *SecurityGroup) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false + _, ok := o.GetCreatedAtOk() + return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *SecurityGroup) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *SecurityGroup) SetCreatedAt(v SecurityGroupGetCreatedAtRetType) { + setSecurityGroupGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *SecurityGroup) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *SecurityGroup) GetDescription() (res SecurityGroupGetDescriptionRetType) { + 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 *SecurityGroup) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *SecurityGroup) GetDescriptionOk() (ret SecurityGroupGetDescriptionRetType, ok bool) { + return getSecurityGroupGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *SecurityGroup) 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 *SecurityGroup) SetDescription(v *string) { - o.Description = v +func (o *SecurityGroup) SetDescription(v SecurityGroupGetDescriptionRetType) { + setSecurityGroupGetDescriptionAttributeType(&o.Description, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *SecurityGroup) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *SecurityGroup) GetId() (res SecurityGroupGetIdRetType) { + 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 *SecurityGroup) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *SecurityGroup) GetIdOk() (ret SecurityGroupGetIdRetType, ok bool) { + return getSecurityGroupGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *SecurityGroup) 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 *SecurityGroup) SetId(v *string) { - o.Id = v +func (o *SecurityGroup) SetId(v SecurityGroupGetIdRetType) { + setSecurityGroupGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *SecurityGroup) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *SecurityGroup) GetLabels() (res SecurityGroupGetLabelsRetType) { + 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 *SecurityGroup) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *SecurityGroup) GetLabelsOk() (ret SecurityGroupGetLabelsRetType, ok bool) { + return getSecurityGroupGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *SecurityGroup) 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 *SecurityGroup) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *SecurityGroup) SetLabels(v SecurityGroupGetLabelsRetType) { + setSecurityGroupGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value -func (o *SecurityGroup) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *SecurityGroup) GetName() (ret SecurityGroupGetNameRetType) { + 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 *SecurityGroup) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *SecurityGroup) GetNameOk() (ret SecurityGroupGetNameRetType, ok bool) { + return getSecurityGroupGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *SecurityGroup) SetName(v *string) { - o.Name = v +func (o *SecurityGroup) SetName(v SecurityGroupGetNameRetType) { + setSecurityGroupGetNameAttributeType(&o.Name, v) } // GetRules returns the Rules field value if set, zero value otherwise. -func (o *SecurityGroup) GetRules() *[]SecurityGroupRule { - if o == nil || IsNil(o.Rules) { - var ret *[]SecurityGroupRule - return ret - } - return o.Rules +func (o *SecurityGroup) GetRules() (res SecurityGroupGetRulesRetType) { + res, _ = o.GetRulesOk() + return } // GetRulesOk returns a tuple with the Rules field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SecurityGroup) GetRulesOk() (*[]SecurityGroupRule, bool) { - if o == nil || IsNil(o.Rules) { - return nil, false - } - return o.Rules, true +func (o *SecurityGroup) GetRulesOk() (ret SecurityGroupGetRulesRetType, ok bool) { + return getSecurityGroupGetRulesAttributeTypeOk(o.Rules) } // HasRules returns a boolean if a field has been set. func (o *SecurityGroup) HasRules() bool { - if o != nil && !IsNil(o.Rules) { - return true - } - - return false + _, ok := o.GetRulesOk() + return ok } // SetRules gets a reference to the given []SecurityGroupRule and assigns it to the Rules field. -func (o *SecurityGroup) SetRules(v *[]SecurityGroupRule) { - o.Rules = v +func (o *SecurityGroup) SetRules(v SecurityGroupGetRulesRetType) { + setSecurityGroupGetRulesAttributeType(&o.Rules, v) } // GetStateful returns the Stateful field value if set, zero value otherwise. -func (o *SecurityGroup) GetStateful() *bool { - if o == nil || IsNil(o.Stateful) { - var ret *bool - return ret - } - return o.Stateful +func (o *SecurityGroup) GetStateful() (res SecurityGroupgetStatefulRetType) { + res, _ = o.GetStatefulOk() + return } // GetStatefulOk returns a tuple with the Stateful field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SecurityGroup) GetStatefulOk() (*bool, bool) { - if o == nil || IsNil(o.Stateful) { - return nil, false - } - return o.Stateful, true +func (o *SecurityGroup) GetStatefulOk() (ret SecurityGroupgetStatefulRetType, ok bool) { + return getSecurityGroupgetStatefulAttributeTypeOk(o.Stateful) } // HasStateful returns a boolean if a field has been set. func (o *SecurityGroup) HasStateful() bool { - if o != nil && !IsNil(o.Stateful) { - return true - } - - return false + _, ok := o.GetStatefulOk() + return ok } // SetStateful gets a reference to the given bool and assigns it to the Stateful field. -func (o *SecurityGroup) SetStateful(v *bool) { - o.Stateful = v +func (o *SecurityGroup) SetStateful(v SecurityGroupgetStatefulRetType) { + setSecurityGroupgetStatefulAttributeType(&o.Stateful, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *SecurityGroup) GetUpdatedAt() *time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret *time.Time - return ret - } - return o.UpdatedAt +func (o *SecurityGroup) GetUpdatedAt() (res SecurityGroupGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SecurityGroup) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true +func (o *SecurityGroup) GetUpdatedAtOk() (ret SecurityGroupGetUpdatedAtRetType, ok bool) { + return getSecurityGroupGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. func (o *SecurityGroup) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false + _, ok := o.GetUpdatedAtOk() + return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *SecurityGroup) SetUpdatedAt(v *time.Time) { - o.UpdatedAt = v +func (o *SecurityGroup) SetUpdatedAt(v SecurityGroupGetUpdatedAtRetType) { + setSecurityGroupGetUpdatedAtAttributeType(&o.UpdatedAt, v) } func (o SecurityGroup) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt + if val, ok := getSecurityGroupGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getSecurityGroupGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getSecurityGroupGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getSecurityGroupGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getSecurityGroupGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - toSerialize["name"] = o.Name - if !IsNil(o.Rules) { - toSerialize["rules"] = o.Rules + if val, ok := getSecurityGroupGetRulesAttributeTypeOk(o.Rules); ok { + toSerialize["Rules"] = val } - if !IsNil(o.Stateful) { - toSerialize["stateful"] = o.Stateful + if val, ok := getSecurityGroupgetStatefulAttributeTypeOk(o.Stateful); ok { + toSerialize["Stateful"] = val } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt + if val, ok := getSecurityGroupGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val } return toSerialize, nil } diff --git a/services/iaas/model_security_group_list_response.go b/services/iaas/model_security_group_list_response.go index 847bf4b98..a45766896 100644 --- a/services/iaas/model_security_group_list_response.go +++ b/services/iaas/model_security_group_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the SecurityGroupListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &SecurityGroupListResponse{} +/* + types and functions for items +*/ + +// isArray +type SecurityGroupListResponseGetItemsAttributeType = *[]SecurityGroup +type SecurityGroupListResponseGetItemsArgType = []SecurityGroup +type SecurityGroupListResponseGetItemsRetType = []SecurityGroup + +func getSecurityGroupListResponseGetItemsAttributeTypeOk(arg SecurityGroupListResponseGetItemsAttributeType) (ret SecurityGroupListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupListResponseGetItemsAttributeType(arg *SecurityGroupListResponseGetItemsAttributeType, val SecurityGroupListResponseGetItemsRetType) { + *arg = &val +} + // SecurityGroupListResponse Security group list response. type SecurityGroupListResponse struct { // A list containing security group objects. // REQUIRED - Items *[]SecurityGroup `json:"items"` + Items SecurityGroupListResponseGetItemsAttributeType `json:"items"` } type _SecurityGroupListResponse SecurityGroupListResponse @@ -30,9 +50,9 @@ type _SecurityGroupListResponse SecurityGroupListResponse // 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 NewSecurityGroupListResponse(items *[]SecurityGroup) *SecurityGroupListResponse { +func NewSecurityGroupListResponse(items SecurityGroupListResponseGetItemsArgType) *SecurityGroupListResponse { this := SecurityGroupListResponse{} - this.Items = items + setSecurityGroupListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewSecurityGroupListResponseWithDefaults() *SecurityGroupListResponse { } // GetItems returns the Items field value -func (o *SecurityGroupListResponse) GetItems() *[]SecurityGroup { - if o == nil || IsNil(o.Items) { - var ret *[]SecurityGroup - return ret - } - - return o.Items +func (o *SecurityGroupListResponse) GetItems() (ret SecurityGroupListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *SecurityGroupListResponse) GetItemsOk() (*[]SecurityGroup, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *SecurityGroupListResponse) GetItemsOk() (ret SecurityGroupListResponseGetItemsRetType, ok bool) { + return getSecurityGroupListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *SecurityGroupListResponse) SetItems(v *[]SecurityGroup) { - o.Items = v +func (o *SecurityGroupListResponse) SetItems(v SecurityGroupListResponseGetItemsRetType) { + setSecurityGroupListResponseGetItemsAttributeType(&o.Items, v) } func (o SecurityGroupListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getSecurityGroupListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_security_group_rule.go b/services/iaas/model_security_group_rule.go index dfa9d6881..86d7751a6 100644 --- a/services/iaas/model_security_group_rule.go +++ b/services/iaas/model_security_group_rule.go @@ -17,26 +17,233 @@ import ( // checks if the SecurityGroupRule type satisfies the MappedNullable interface at compile time var _ MappedNullable = &SecurityGroupRule{} +/* + types and functions for description +*/ + +// isNotNullableString +type SecurityGroupRuleGetDescriptionAttributeType = *string + +func getSecurityGroupRuleGetDescriptionAttributeTypeOk(arg SecurityGroupRuleGetDescriptionAttributeType) (ret SecurityGroupRuleGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupRuleGetDescriptionAttributeType(arg *SecurityGroupRuleGetDescriptionAttributeType, val SecurityGroupRuleGetDescriptionRetType) { + *arg = &val +} + +type SecurityGroupRuleGetDescriptionArgType = string +type SecurityGroupRuleGetDescriptionRetType = string + +/* + types and functions for direction +*/ + +// isNotNullableString +type SecurityGroupRuleGetDirectionAttributeType = *string + +func getSecurityGroupRuleGetDirectionAttributeTypeOk(arg SecurityGroupRuleGetDirectionAttributeType) (ret SecurityGroupRuleGetDirectionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupRuleGetDirectionAttributeType(arg *SecurityGroupRuleGetDirectionAttributeType, val SecurityGroupRuleGetDirectionRetType) { + *arg = &val +} + +type SecurityGroupRuleGetDirectionArgType = string +type SecurityGroupRuleGetDirectionRetType = string + +/* + types and functions for ethertype +*/ + +// isNotNullableString +type SecurityGroupRuleGetEthertypeAttributeType = *string + +func getSecurityGroupRuleGetEthertypeAttributeTypeOk(arg SecurityGroupRuleGetEthertypeAttributeType) (ret SecurityGroupRuleGetEthertypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupRuleGetEthertypeAttributeType(arg *SecurityGroupRuleGetEthertypeAttributeType, val SecurityGroupRuleGetEthertypeRetType) { + *arg = &val +} + +type SecurityGroupRuleGetEthertypeArgType = string +type SecurityGroupRuleGetEthertypeRetType = string + +/* + types and functions for icmpParameters +*/ + +// isModel +type SecurityGroupRuleGetIcmpParametersAttributeType = *ICMPParameters +type SecurityGroupRuleGetIcmpParametersArgType = ICMPParameters +type SecurityGroupRuleGetIcmpParametersRetType = ICMPParameters + +func getSecurityGroupRuleGetIcmpParametersAttributeTypeOk(arg SecurityGroupRuleGetIcmpParametersAttributeType) (ret SecurityGroupRuleGetIcmpParametersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupRuleGetIcmpParametersAttributeType(arg *SecurityGroupRuleGetIcmpParametersAttributeType, val SecurityGroupRuleGetIcmpParametersRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type SecurityGroupRuleGetIdAttributeType = *string + +func getSecurityGroupRuleGetIdAttributeTypeOk(arg SecurityGroupRuleGetIdAttributeType) (ret SecurityGroupRuleGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupRuleGetIdAttributeType(arg *SecurityGroupRuleGetIdAttributeType, val SecurityGroupRuleGetIdRetType) { + *arg = &val +} + +type SecurityGroupRuleGetIdArgType = string +type SecurityGroupRuleGetIdRetType = string + +/* + types and functions for ipRange +*/ + +// isNotNullableString +type SecurityGroupRuleGetIpRangeAttributeType = *string + +func getSecurityGroupRuleGetIpRangeAttributeTypeOk(arg SecurityGroupRuleGetIpRangeAttributeType) (ret SecurityGroupRuleGetIpRangeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupRuleGetIpRangeAttributeType(arg *SecurityGroupRuleGetIpRangeAttributeType, val SecurityGroupRuleGetIpRangeRetType) { + *arg = &val +} + +type SecurityGroupRuleGetIpRangeArgType = string +type SecurityGroupRuleGetIpRangeRetType = string + +/* + types and functions for portRange +*/ + +// isModel +type SecurityGroupRuleGetPortRangeAttributeType = *PortRange +type SecurityGroupRuleGetPortRangeArgType = PortRange +type SecurityGroupRuleGetPortRangeRetType = PortRange + +func getSecurityGroupRuleGetPortRangeAttributeTypeOk(arg SecurityGroupRuleGetPortRangeAttributeType) (ret SecurityGroupRuleGetPortRangeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupRuleGetPortRangeAttributeType(arg *SecurityGroupRuleGetPortRangeAttributeType, val SecurityGroupRuleGetPortRangeRetType) { + *arg = &val +} + +/* + types and functions for remoteSecurityGroupId +*/ + +// isNotNullableString +type SecurityGroupRuleGetRemoteSecurityGroupIdAttributeType = *string + +func getSecurityGroupRuleGetRemoteSecurityGroupIdAttributeTypeOk(arg SecurityGroupRuleGetRemoteSecurityGroupIdAttributeType) (ret SecurityGroupRuleGetRemoteSecurityGroupIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType(arg *SecurityGroupRuleGetRemoteSecurityGroupIdAttributeType, val SecurityGroupRuleGetRemoteSecurityGroupIdRetType) { + *arg = &val +} + +type SecurityGroupRuleGetRemoteSecurityGroupIdArgType = string +type SecurityGroupRuleGetRemoteSecurityGroupIdRetType = string + +/* + types and functions for securityGroupId +*/ + +// isNotNullableString +type SecurityGroupRuleGetSecurityGroupIdAttributeType = *string + +func getSecurityGroupRuleGetSecurityGroupIdAttributeTypeOk(arg SecurityGroupRuleGetSecurityGroupIdAttributeType) (ret SecurityGroupRuleGetSecurityGroupIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupRuleGetSecurityGroupIdAttributeType(arg *SecurityGroupRuleGetSecurityGroupIdAttributeType, val SecurityGroupRuleGetSecurityGroupIdRetType) { + *arg = &val +} + +type SecurityGroupRuleGetSecurityGroupIdArgType = string +type SecurityGroupRuleGetSecurityGroupIdRetType = string + +/* + types and functions for protocol +*/ + +// isModel +type SecurityGroupRuleGetProtocolAttributeType = *Protocol +type SecurityGroupRuleGetProtocolArgType = Protocol +type SecurityGroupRuleGetProtocolRetType = Protocol + +func getSecurityGroupRuleGetProtocolAttributeTypeOk(arg SecurityGroupRuleGetProtocolAttributeType) (ret SecurityGroupRuleGetProtocolRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupRuleGetProtocolAttributeType(arg *SecurityGroupRuleGetProtocolAttributeType, val SecurityGroupRuleGetProtocolRetType) { + *arg = &val +} + // SecurityGroupRule Object that represents a security group rule. type SecurityGroupRule struct { // Description Object. Allows string up to 127 Characters. - Description *string `json:"description,omitempty"` + Description SecurityGroupRuleGetDescriptionAttributeType `json:"description,omitempty"` // The direction of the traffic which the rule should match. // REQUIRED - Direction *string `json:"direction"` + Direction SecurityGroupRuleGetDirectionAttributeType `json:"direction"` // The ethertype which the rule should match. - Ethertype *string `json:"ethertype,omitempty"` - IcmpParameters *ICMPParameters `json:"icmpParameters,omitempty"` + Ethertype SecurityGroupRuleGetEthertypeAttributeType `json:"ethertype,omitempty"` + IcmpParameters SecurityGroupRuleGetIcmpParametersAttributeType `json:"icmpParameters,omitempty"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id SecurityGroupRuleGetIdAttributeType `json:"id,omitempty"` // Classless Inter-Domain Routing (CIDR). - IpRange *string `json:"ipRange,omitempty"` - PortRange *PortRange `json:"portRange,omitempty"` + IpRange SecurityGroupRuleGetIpRangeAttributeType `json:"ipRange,omitempty"` + PortRange SecurityGroupRuleGetPortRangeAttributeType `json:"portRange,omitempty"` // Universally Unique Identifier (UUID). - RemoteSecurityGroupId *string `json:"remoteSecurityGroupId,omitempty"` + RemoteSecurityGroupId SecurityGroupRuleGetRemoteSecurityGroupIdAttributeType `json:"remoteSecurityGroupId,omitempty"` // Universally Unique Identifier (UUID). - SecurityGroupId *string `json:"securityGroupId,omitempty"` - Protocol *Protocol `json:"protocol,omitempty"` + SecurityGroupId SecurityGroupRuleGetSecurityGroupIdAttributeType `json:"securityGroupId,omitempty"` + Protocol SecurityGroupRuleGetProtocolAttributeType `json:"protocol,omitempty"` } type _SecurityGroupRule SecurityGroupRule @@ -45,11 +252,9 @@ type _SecurityGroupRule SecurityGroupRule // 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 NewSecurityGroupRule(direction *string) *SecurityGroupRule { +func NewSecurityGroupRule(direction SecurityGroupRuleGetDirectionArgType) *SecurityGroupRule { this := SecurityGroupRule{} - this.Direction = direction - var ethertype string = "IPv4" - this.Ethertype = ðertype + setSecurityGroupRuleGetDirectionAttributeType(&this.Direction, direction) return &this } @@ -64,346 +269,260 @@ func NewSecurityGroupRuleWithDefaults() *SecurityGroupRule { } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *SecurityGroupRule) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *SecurityGroupRule) GetDescription() (res SecurityGroupRuleGetDescriptionRetType) { + 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 *SecurityGroupRule) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *SecurityGroupRule) GetDescriptionOk() (ret SecurityGroupRuleGetDescriptionRetType, ok bool) { + return getSecurityGroupRuleGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *SecurityGroupRule) 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 *SecurityGroupRule) SetDescription(v *string) { - o.Description = v +func (o *SecurityGroupRule) SetDescription(v SecurityGroupRuleGetDescriptionRetType) { + setSecurityGroupRuleGetDescriptionAttributeType(&o.Description, v) } // GetDirection returns the Direction field value -func (o *SecurityGroupRule) GetDirection() *string { - if o == nil || IsNil(o.Direction) { - var ret *string - return ret - } - - return o.Direction +func (o *SecurityGroupRule) GetDirection() (ret SecurityGroupRuleGetDirectionRetType) { + ret, _ = o.GetDirectionOk() + return ret } // GetDirectionOk returns a tuple with the Direction field value // and a boolean to check if the value has been set. -func (o *SecurityGroupRule) GetDirectionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Direction, true +func (o *SecurityGroupRule) GetDirectionOk() (ret SecurityGroupRuleGetDirectionRetType, ok bool) { + return getSecurityGroupRuleGetDirectionAttributeTypeOk(o.Direction) } // SetDirection sets field value -func (o *SecurityGroupRule) SetDirection(v *string) { - o.Direction = v +func (o *SecurityGroupRule) SetDirection(v SecurityGroupRuleGetDirectionRetType) { + setSecurityGroupRuleGetDirectionAttributeType(&o.Direction, v) } // GetEthertype returns the Ethertype field value if set, zero value otherwise. -func (o *SecurityGroupRule) GetEthertype() *string { - if o == nil || IsNil(o.Ethertype) { - var ret *string - return ret - } - return o.Ethertype +func (o *SecurityGroupRule) GetEthertype() (res SecurityGroupRuleGetEthertypeRetType) { + res, _ = o.GetEthertypeOk() + return } // GetEthertypeOk returns a tuple with the Ethertype field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SecurityGroupRule) GetEthertypeOk() (*string, bool) { - if o == nil || IsNil(o.Ethertype) { - return nil, false - } - return o.Ethertype, true +func (o *SecurityGroupRule) GetEthertypeOk() (ret SecurityGroupRuleGetEthertypeRetType, ok bool) { + return getSecurityGroupRuleGetEthertypeAttributeTypeOk(o.Ethertype) } // HasEthertype returns a boolean if a field has been set. func (o *SecurityGroupRule) HasEthertype() bool { - if o != nil && !IsNil(o.Ethertype) { - return true - } - - return false + _, ok := o.GetEthertypeOk() + return ok } // SetEthertype gets a reference to the given string and assigns it to the Ethertype field. -func (o *SecurityGroupRule) SetEthertype(v *string) { - o.Ethertype = v +func (o *SecurityGroupRule) SetEthertype(v SecurityGroupRuleGetEthertypeRetType) { + setSecurityGroupRuleGetEthertypeAttributeType(&o.Ethertype, v) } // GetIcmpParameters returns the IcmpParameters field value if set, zero value otherwise. -func (o *SecurityGroupRule) GetIcmpParameters() *ICMPParameters { - if o == nil || IsNil(o.IcmpParameters) { - var ret *ICMPParameters - return ret - } - return o.IcmpParameters +func (o *SecurityGroupRule) GetIcmpParameters() (res SecurityGroupRuleGetIcmpParametersRetType) { + res, _ = o.GetIcmpParametersOk() + return } // GetIcmpParametersOk returns a tuple with the IcmpParameters field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SecurityGroupRule) GetIcmpParametersOk() (*ICMPParameters, bool) { - if o == nil || IsNil(o.IcmpParameters) { - return nil, false - } - return o.IcmpParameters, true +func (o *SecurityGroupRule) GetIcmpParametersOk() (ret SecurityGroupRuleGetIcmpParametersRetType, ok bool) { + return getSecurityGroupRuleGetIcmpParametersAttributeTypeOk(o.IcmpParameters) } // HasIcmpParameters returns a boolean if a field has been set. func (o *SecurityGroupRule) HasIcmpParameters() bool { - if o != nil && !IsNil(o.IcmpParameters) { - return true - } - - return false + _, ok := o.GetIcmpParametersOk() + return ok } // SetIcmpParameters gets a reference to the given ICMPParameters and assigns it to the IcmpParameters field. -func (o *SecurityGroupRule) SetIcmpParameters(v *ICMPParameters) { - o.IcmpParameters = v +func (o *SecurityGroupRule) SetIcmpParameters(v SecurityGroupRuleGetIcmpParametersRetType) { + setSecurityGroupRuleGetIcmpParametersAttributeType(&o.IcmpParameters, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *SecurityGroupRule) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *SecurityGroupRule) GetId() (res SecurityGroupRuleGetIdRetType) { + 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 *SecurityGroupRule) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *SecurityGroupRule) GetIdOk() (ret SecurityGroupRuleGetIdRetType, ok bool) { + return getSecurityGroupRuleGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *SecurityGroupRule) 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 *SecurityGroupRule) SetId(v *string) { - o.Id = v +func (o *SecurityGroupRule) SetId(v SecurityGroupRuleGetIdRetType) { + setSecurityGroupRuleGetIdAttributeType(&o.Id, v) } // GetIpRange returns the IpRange field value if set, zero value otherwise. -func (o *SecurityGroupRule) GetIpRange() *string { - if o == nil || IsNil(o.IpRange) { - var ret *string - return ret - } - return o.IpRange +func (o *SecurityGroupRule) GetIpRange() (res SecurityGroupRuleGetIpRangeRetType) { + res, _ = o.GetIpRangeOk() + return } // GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SecurityGroupRule) GetIpRangeOk() (*string, bool) { - if o == nil || IsNil(o.IpRange) { - return nil, false - } - return o.IpRange, true +func (o *SecurityGroupRule) GetIpRangeOk() (ret SecurityGroupRuleGetIpRangeRetType, ok bool) { + return getSecurityGroupRuleGetIpRangeAttributeTypeOk(o.IpRange) } // HasIpRange returns a boolean if a field has been set. func (o *SecurityGroupRule) HasIpRange() bool { - if o != nil && !IsNil(o.IpRange) { - return true - } - - return false + _, ok := o.GetIpRangeOk() + return ok } // SetIpRange gets a reference to the given string and assigns it to the IpRange field. -func (o *SecurityGroupRule) SetIpRange(v *string) { - o.IpRange = v +func (o *SecurityGroupRule) SetIpRange(v SecurityGroupRuleGetIpRangeRetType) { + setSecurityGroupRuleGetIpRangeAttributeType(&o.IpRange, v) } // GetPortRange returns the PortRange field value if set, zero value otherwise. -func (o *SecurityGroupRule) GetPortRange() *PortRange { - if o == nil || IsNil(o.PortRange) { - var ret *PortRange - return ret - } - return o.PortRange +func (o *SecurityGroupRule) GetPortRange() (res SecurityGroupRuleGetPortRangeRetType) { + res, _ = o.GetPortRangeOk() + return } // GetPortRangeOk returns a tuple with the PortRange field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SecurityGroupRule) GetPortRangeOk() (*PortRange, bool) { - if o == nil || IsNil(o.PortRange) { - return nil, false - } - return o.PortRange, true +func (o *SecurityGroupRule) GetPortRangeOk() (ret SecurityGroupRuleGetPortRangeRetType, ok bool) { + return getSecurityGroupRuleGetPortRangeAttributeTypeOk(o.PortRange) } // HasPortRange returns a boolean if a field has been set. func (o *SecurityGroupRule) HasPortRange() bool { - if o != nil && !IsNil(o.PortRange) { - return true - } - - return false + _, ok := o.GetPortRangeOk() + return ok } // SetPortRange gets a reference to the given PortRange and assigns it to the PortRange field. -func (o *SecurityGroupRule) SetPortRange(v *PortRange) { - o.PortRange = v +func (o *SecurityGroupRule) SetPortRange(v SecurityGroupRuleGetPortRangeRetType) { + setSecurityGroupRuleGetPortRangeAttributeType(&o.PortRange, v) } // GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. -func (o *SecurityGroupRule) GetRemoteSecurityGroupId() *string { - if o == nil || IsNil(o.RemoteSecurityGroupId) { - var ret *string - return ret - } - return o.RemoteSecurityGroupId +func (o *SecurityGroupRule) GetRemoteSecurityGroupId() (res SecurityGroupRuleGetRemoteSecurityGroupIdRetType) { + res, _ = o.GetRemoteSecurityGroupIdOk() + return } // GetRemoteSecurityGroupIdOk returns a tuple with the RemoteSecurityGroupId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SecurityGroupRule) GetRemoteSecurityGroupIdOk() (*string, bool) { - if o == nil || IsNil(o.RemoteSecurityGroupId) { - return nil, false - } - return o.RemoteSecurityGroupId, true +func (o *SecurityGroupRule) GetRemoteSecurityGroupIdOk() (ret SecurityGroupRuleGetRemoteSecurityGroupIdRetType, ok bool) { + return getSecurityGroupRuleGetRemoteSecurityGroupIdAttributeTypeOk(o.RemoteSecurityGroupId) } // HasRemoteSecurityGroupId returns a boolean if a field has been set. func (o *SecurityGroupRule) HasRemoteSecurityGroupId() bool { - if o != nil && !IsNil(o.RemoteSecurityGroupId) { - return true - } - - return false + _, ok := o.GetRemoteSecurityGroupIdOk() + return ok } // SetRemoteSecurityGroupId gets a reference to the given string and assigns it to the RemoteSecurityGroupId field. -func (o *SecurityGroupRule) SetRemoteSecurityGroupId(v *string) { - o.RemoteSecurityGroupId = v +func (o *SecurityGroupRule) SetRemoteSecurityGroupId(v SecurityGroupRuleGetRemoteSecurityGroupIdRetType) { + setSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType(&o.RemoteSecurityGroupId, v) } // GetSecurityGroupId returns the SecurityGroupId field value if set, zero value otherwise. -func (o *SecurityGroupRule) GetSecurityGroupId() *string { - if o == nil || IsNil(o.SecurityGroupId) { - var ret *string - return ret - } - return o.SecurityGroupId +func (o *SecurityGroupRule) GetSecurityGroupId() (res SecurityGroupRuleGetSecurityGroupIdRetType) { + res, _ = o.GetSecurityGroupIdOk() + return } // GetSecurityGroupIdOk returns a tuple with the SecurityGroupId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SecurityGroupRule) GetSecurityGroupIdOk() (*string, bool) { - if o == nil || IsNil(o.SecurityGroupId) { - return nil, false - } - return o.SecurityGroupId, true +func (o *SecurityGroupRule) GetSecurityGroupIdOk() (ret SecurityGroupRuleGetSecurityGroupIdRetType, ok bool) { + return getSecurityGroupRuleGetSecurityGroupIdAttributeTypeOk(o.SecurityGroupId) } // HasSecurityGroupId returns a boolean if a field has been set. func (o *SecurityGroupRule) HasSecurityGroupId() bool { - if o != nil && !IsNil(o.SecurityGroupId) { - return true - } - - return false + _, ok := o.GetSecurityGroupIdOk() + return ok } // SetSecurityGroupId gets a reference to the given string and assigns it to the SecurityGroupId field. -func (o *SecurityGroupRule) SetSecurityGroupId(v *string) { - o.SecurityGroupId = v +func (o *SecurityGroupRule) SetSecurityGroupId(v SecurityGroupRuleGetSecurityGroupIdRetType) { + setSecurityGroupRuleGetSecurityGroupIdAttributeType(&o.SecurityGroupId, v) } // GetProtocol returns the Protocol field value if set, zero value otherwise. -func (o *SecurityGroupRule) GetProtocol() *Protocol { - if o == nil || IsNil(o.Protocol) { - var ret *Protocol - return ret - } - return o.Protocol +func (o *SecurityGroupRule) GetProtocol() (res SecurityGroupRuleGetProtocolRetType) { + res, _ = o.GetProtocolOk() + return } // GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SecurityGroupRule) GetProtocolOk() (*Protocol, bool) { - if o == nil || IsNil(o.Protocol) { - return nil, false - } - return o.Protocol, true +func (o *SecurityGroupRule) GetProtocolOk() (ret SecurityGroupRuleGetProtocolRetType, ok bool) { + return getSecurityGroupRuleGetProtocolAttributeTypeOk(o.Protocol) } // HasProtocol returns a boolean if a field has been set. func (o *SecurityGroupRule) HasProtocol() bool { - if o != nil && !IsNil(o.Protocol) { - return true - } - - return false + _, ok := o.GetProtocolOk() + return ok } // SetProtocol gets a reference to the given Protocol and assigns it to the Protocol field. -func (o *SecurityGroupRule) SetProtocol(v *Protocol) { - o.Protocol = v +func (o *SecurityGroupRule) SetProtocol(v SecurityGroupRuleGetProtocolRetType) { + setSecurityGroupRuleGetProtocolAttributeType(&o.Protocol, v) } func (o SecurityGroupRule) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getSecurityGroupRuleGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getSecurityGroupRuleGetDirectionAttributeTypeOk(o.Direction); ok { + toSerialize["Direction"] = val } - toSerialize["direction"] = o.Direction - if !IsNil(o.Ethertype) { - toSerialize["ethertype"] = o.Ethertype + if val, ok := getSecurityGroupRuleGetEthertypeAttributeTypeOk(o.Ethertype); ok { + toSerialize["Ethertype"] = val } - if !IsNil(o.IcmpParameters) { - toSerialize["icmpParameters"] = o.IcmpParameters + if val, ok := getSecurityGroupRuleGetIcmpParametersAttributeTypeOk(o.IcmpParameters); ok { + toSerialize["IcmpParameters"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getSecurityGroupRuleGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.IpRange) { - toSerialize["ipRange"] = o.IpRange + if val, ok := getSecurityGroupRuleGetIpRangeAttributeTypeOk(o.IpRange); ok { + toSerialize["IpRange"] = val } - if !IsNil(o.PortRange) { - toSerialize["portRange"] = o.PortRange + if val, ok := getSecurityGroupRuleGetPortRangeAttributeTypeOk(o.PortRange); ok { + toSerialize["PortRange"] = val } - if !IsNil(o.RemoteSecurityGroupId) { - toSerialize["remoteSecurityGroupId"] = o.RemoteSecurityGroupId + if val, ok := getSecurityGroupRuleGetRemoteSecurityGroupIdAttributeTypeOk(o.RemoteSecurityGroupId); ok { + toSerialize["RemoteSecurityGroupId"] = val } - if !IsNil(o.SecurityGroupId) { - toSerialize["securityGroupId"] = o.SecurityGroupId + if val, ok := getSecurityGroupRuleGetSecurityGroupIdAttributeTypeOk(o.SecurityGroupId); ok { + toSerialize["SecurityGroupId"] = val } - if !IsNil(o.Protocol) { - toSerialize["protocol"] = o.Protocol + if val, ok := getSecurityGroupRuleGetProtocolAttributeTypeOk(o.Protocol); ok { + toSerialize["Protocol"] = val } return toSerialize, nil } diff --git a/services/iaas/model_security_group_rule_list_response.go b/services/iaas/model_security_group_rule_list_response.go index 40157f3be..634ae38b1 100644 --- a/services/iaas/model_security_group_rule_list_response.go +++ b/services/iaas/model_security_group_rule_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the SecurityGroupRuleListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &SecurityGroupRuleListResponse{} +/* + types and functions for items +*/ + +// isArray +type SecurityGroupRuleListResponseGetItemsAttributeType = *[]SecurityGroupRule +type SecurityGroupRuleListResponseGetItemsArgType = []SecurityGroupRule +type SecurityGroupRuleListResponseGetItemsRetType = []SecurityGroupRule + +func getSecurityGroupRuleListResponseGetItemsAttributeTypeOk(arg SecurityGroupRuleListResponseGetItemsAttributeType) (ret SecurityGroupRuleListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupRuleListResponseGetItemsAttributeType(arg *SecurityGroupRuleListResponseGetItemsAttributeType, val SecurityGroupRuleListResponseGetItemsRetType) { + *arg = &val +} + // SecurityGroupRuleListResponse Security group rule list response. type SecurityGroupRuleListResponse struct { // A list containing security group rule objects. // REQUIRED - Items *[]SecurityGroupRule `json:"items"` + Items SecurityGroupRuleListResponseGetItemsAttributeType `json:"items"` } type _SecurityGroupRuleListResponse SecurityGroupRuleListResponse @@ -30,9 +50,9 @@ type _SecurityGroupRuleListResponse SecurityGroupRuleListResponse // 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 NewSecurityGroupRuleListResponse(items *[]SecurityGroupRule) *SecurityGroupRuleListResponse { +func NewSecurityGroupRuleListResponse(items SecurityGroupRuleListResponseGetItemsArgType) *SecurityGroupRuleListResponse { this := SecurityGroupRuleListResponse{} - this.Items = items + setSecurityGroupRuleListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewSecurityGroupRuleListResponseWithDefaults() *SecurityGroupRuleListRespon } // GetItems returns the Items field value -func (o *SecurityGroupRuleListResponse) GetItems() *[]SecurityGroupRule { - if o == nil || IsNil(o.Items) { - var ret *[]SecurityGroupRule - return ret - } - - return o.Items +func (o *SecurityGroupRuleListResponse) GetItems() (ret SecurityGroupRuleListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *SecurityGroupRuleListResponse) GetItemsOk() (*[]SecurityGroupRule, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *SecurityGroupRuleListResponse) GetItemsOk() (ret SecurityGroupRuleListResponseGetItemsRetType, ok bool) { + return getSecurityGroupRuleListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *SecurityGroupRuleListResponse) SetItems(v *[]SecurityGroupRule) { - o.Items = v +func (o *SecurityGroupRuleListResponse) SetItems(v SecurityGroupRuleListResponseGetItemsRetType) { + setSecurityGroupRuleListResponseGetItemsAttributeType(&o.Items, v) } func (o SecurityGroupRuleListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getSecurityGroupRuleListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_security_group_rule_protocol.go b/services/iaas/model_security_group_rule_protocol.go index 2778627df..1f8a0cbd5 100644 --- a/services/iaas/model_security_group_rule_protocol.go +++ b/services/iaas/model_security_group_rule_protocol.go @@ -17,9 +17,29 @@ import ( // checks if the SecurityGroupRuleProtocol type satisfies the MappedNullable interface at compile time var _ MappedNullable = &SecurityGroupRuleProtocol{} +/* + types and functions for protocol +*/ + +// isModel +type SecurityGroupRuleProtocolGetProtocolAttributeType = *Protocol +type SecurityGroupRuleProtocolGetProtocolArgType = Protocol +type SecurityGroupRuleProtocolGetProtocolRetType = Protocol + +func getSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(arg SecurityGroupRuleProtocolGetProtocolAttributeType) (ret SecurityGroupRuleProtocolGetProtocolRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSecurityGroupRuleProtocolGetProtocolAttributeType(arg *SecurityGroupRuleProtocolGetProtocolAttributeType, val SecurityGroupRuleProtocolGetProtocolRetType) { + *arg = &val +} + // SecurityGroupRuleProtocol The internet protocol which the rule matches. type SecurityGroupRuleProtocol struct { - Protocol *Protocol `json:"protocol,omitempty"` + Protocol SecurityGroupRuleProtocolGetProtocolAttributeType `json:"protocol,omitempty"` } // NewSecurityGroupRuleProtocol instantiates a new SecurityGroupRuleProtocol object @@ -40,41 +60,32 @@ func NewSecurityGroupRuleProtocolWithDefaults() *SecurityGroupRuleProtocol { } // GetProtocol returns the Protocol field value if set, zero value otherwise. -func (o *SecurityGroupRuleProtocol) GetProtocol() *Protocol { - if o == nil || IsNil(o.Protocol) { - var ret *Protocol - return ret - } - return o.Protocol +func (o *SecurityGroupRuleProtocol) GetProtocol() (res SecurityGroupRuleProtocolGetProtocolRetType) { + res, _ = o.GetProtocolOk() + return } // GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SecurityGroupRuleProtocol) GetProtocolOk() (*Protocol, bool) { - if o == nil || IsNil(o.Protocol) { - return nil, false - } - return o.Protocol, true +func (o *SecurityGroupRuleProtocol) GetProtocolOk() (ret SecurityGroupRuleProtocolGetProtocolRetType, ok bool) { + return getSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(o.Protocol) } // HasProtocol returns a boolean if a field has been set. func (o *SecurityGroupRuleProtocol) HasProtocol() bool { - if o != nil && !IsNil(o.Protocol) { - return true - } - - return false + _, ok := o.GetProtocolOk() + return ok } // SetProtocol gets a reference to the given Protocol and assigns it to the Protocol field. -func (o *SecurityGroupRuleProtocol) SetProtocol(v *Protocol) { - o.Protocol = v +func (o *SecurityGroupRuleProtocol) SetProtocol(v SecurityGroupRuleProtocolGetProtocolRetType) { + setSecurityGroupRuleProtocolGetProtocolAttributeType(&o.Protocol, v) } func (o SecurityGroupRuleProtocol) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Protocol) { - toSerialize["protocol"] = o.Protocol + if val, ok := getSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(o.Protocol); ok { + toSerialize["Protocol"] = val } return toSerialize, nil } diff --git a/services/iaas/model_server.go b/services/iaas/model_server.go index a8ea807d9..7b812a4b6 100644 --- a/services/iaas/model_server.go +++ b/services/iaas/model_server.go @@ -18,51 +18,501 @@ import ( // checks if the Server type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Server{} +/* + types and functions for affinityGroup +*/ + +// isNotNullableString +type ServerGetAffinityGroupAttributeType = *string + +func getServerGetAffinityGroupAttributeTypeOk(arg ServerGetAffinityGroupAttributeType) (ret ServerGetAffinityGroupRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetAffinityGroupAttributeType(arg *ServerGetAffinityGroupAttributeType, val ServerGetAffinityGroupRetType) { + *arg = &val +} + +type ServerGetAffinityGroupArgType = string +type ServerGetAffinityGroupRetType = string + +/* + types and functions for availabilityZone +*/ + +// isNotNullableString +type ServerGetAvailabilityZoneAttributeType = *string + +func getServerGetAvailabilityZoneAttributeTypeOk(arg ServerGetAvailabilityZoneAttributeType) (ret ServerGetAvailabilityZoneRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetAvailabilityZoneAttributeType(arg *ServerGetAvailabilityZoneAttributeType, val ServerGetAvailabilityZoneRetType) { + *arg = &val +} + +type ServerGetAvailabilityZoneArgType = string +type ServerGetAvailabilityZoneRetType = string + +/* + types and functions for bootVolume +*/ + +// isModel +type ServerGetBootVolumeAttributeType = *CreateServerPayloadBootVolume +type ServerGetBootVolumeArgType = CreateServerPayloadBootVolume +type ServerGetBootVolumeRetType = CreateServerPayloadBootVolume + +func getServerGetBootVolumeAttributeTypeOk(arg ServerGetBootVolumeAttributeType) (ret ServerGetBootVolumeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetBootVolumeAttributeType(arg *ServerGetBootVolumeAttributeType, val ServerGetBootVolumeRetType) { + *arg = &val +} + +/* + types and functions for createdAt +*/ + +// isDateTime +type ServerGetCreatedAtAttributeType = *time.Time +type ServerGetCreatedAtArgType = time.Time +type ServerGetCreatedAtRetType = time.Time + +func getServerGetCreatedAtAttributeTypeOk(arg ServerGetCreatedAtAttributeType) (ret ServerGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetCreatedAtAttributeType(arg *ServerGetCreatedAtAttributeType, val ServerGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for errorMessage +*/ + +// isNotNullableString +type ServerGetErrorMessageAttributeType = *string + +func getServerGetErrorMessageAttributeTypeOk(arg ServerGetErrorMessageAttributeType) (ret ServerGetErrorMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetErrorMessageAttributeType(arg *ServerGetErrorMessageAttributeType, val ServerGetErrorMessageRetType) { + *arg = &val +} + +type ServerGetErrorMessageArgType = string +type ServerGetErrorMessageRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type ServerGetIdAttributeType = *string + +func getServerGetIdAttributeTypeOk(arg ServerGetIdAttributeType) (ret ServerGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetIdAttributeType(arg *ServerGetIdAttributeType, val ServerGetIdRetType) { + *arg = &val +} + +type ServerGetIdArgType = string +type ServerGetIdRetType = string + +/* + types and functions for imageId +*/ + +// isNotNullableString +type ServerGetImageIdAttributeType = *string + +func getServerGetImageIdAttributeTypeOk(arg ServerGetImageIdAttributeType) (ret ServerGetImageIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetImageIdAttributeType(arg *ServerGetImageIdAttributeType, val ServerGetImageIdRetType) { + *arg = &val +} + +type ServerGetImageIdArgType = string +type ServerGetImageIdRetType = string + +/* + types and functions for keypairName +*/ + +// isNotNullableString +type ServerGetKeypairNameAttributeType = *string + +func getServerGetKeypairNameAttributeTypeOk(arg ServerGetKeypairNameAttributeType) (ret ServerGetKeypairNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetKeypairNameAttributeType(arg *ServerGetKeypairNameAttributeType, val ServerGetKeypairNameRetType) { + *arg = &val +} + +type ServerGetKeypairNameArgType = string +type ServerGetKeypairNameRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type ServerGetLabelsAttributeType = *map[string]interface{} +type ServerGetLabelsArgType = map[string]interface{} +type ServerGetLabelsRetType = map[string]interface{} + +func getServerGetLabelsAttributeTypeOk(arg ServerGetLabelsAttributeType) (ret ServerGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetLabelsAttributeType(arg *ServerGetLabelsAttributeType, val ServerGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for launchedAt +*/ + +// isDateTime +type ServerGetLaunchedAtAttributeType = *time.Time +type ServerGetLaunchedAtArgType = time.Time +type ServerGetLaunchedAtRetType = time.Time + +func getServerGetLaunchedAtAttributeTypeOk(arg ServerGetLaunchedAtAttributeType) (ret ServerGetLaunchedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetLaunchedAtAttributeType(arg *ServerGetLaunchedAtAttributeType, val ServerGetLaunchedAtRetType) { + *arg = &val +} + +/* + types and functions for machineType +*/ + +// isNotNullableString +type ServerGetMachineTypeAttributeType = *string + +func getServerGetMachineTypeAttributeTypeOk(arg ServerGetMachineTypeAttributeType) (ret ServerGetMachineTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetMachineTypeAttributeType(arg *ServerGetMachineTypeAttributeType, val ServerGetMachineTypeRetType) { + *arg = &val +} + +type ServerGetMachineTypeArgType = string +type ServerGetMachineTypeRetType = string + +/* + types and functions for maintenanceWindow +*/ + +// isModel +type ServerGetMaintenanceWindowAttributeType = *ServerMaintenance +type ServerGetMaintenanceWindowArgType = ServerMaintenance +type ServerGetMaintenanceWindowRetType = ServerMaintenance + +func getServerGetMaintenanceWindowAttributeTypeOk(arg ServerGetMaintenanceWindowAttributeType) (ret ServerGetMaintenanceWindowRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetMaintenanceWindowAttributeType(arg *ServerGetMaintenanceWindowAttributeType, val ServerGetMaintenanceWindowRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type ServerGetNameAttributeType = *string + +func getServerGetNameAttributeTypeOk(arg ServerGetNameAttributeType) (ret ServerGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetNameAttributeType(arg *ServerGetNameAttributeType, val ServerGetNameRetType) { + *arg = &val +} + +type ServerGetNameArgType = string +type ServerGetNameRetType = string + +/* + types and functions for networking +*/ + +// isModel +type ServerGetNetworkingAttributeType = *CreateServerPayloadNetworking +type ServerGetNetworkingArgType = CreateServerPayloadNetworking +type ServerGetNetworkingRetType = CreateServerPayloadNetworking + +func getServerGetNetworkingAttributeTypeOk(arg ServerGetNetworkingAttributeType) (ret ServerGetNetworkingRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetNetworkingAttributeType(arg *ServerGetNetworkingAttributeType, val ServerGetNetworkingRetType) { + *arg = &val +} + +/* + types and functions for nics +*/ + +// isArray +type ServerGetNicsAttributeType = *[]ServerNetwork +type ServerGetNicsArgType = []ServerNetwork +type ServerGetNicsRetType = []ServerNetwork + +func getServerGetNicsAttributeTypeOk(arg ServerGetNicsAttributeType) (ret ServerGetNicsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetNicsAttributeType(arg *ServerGetNicsAttributeType, val ServerGetNicsRetType) { + *arg = &val +} + +/* + types and functions for powerStatus +*/ + +// isNotNullableString +type ServerGetPowerStatusAttributeType = *string + +func getServerGetPowerStatusAttributeTypeOk(arg ServerGetPowerStatusAttributeType) (ret ServerGetPowerStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetPowerStatusAttributeType(arg *ServerGetPowerStatusAttributeType, val ServerGetPowerStatusRetType) { + *arg = &val +} + +type ServerGetPowerStatusArgType = string +type ServerGetPowerStatusRetType = string + +/* + types and functions for securityGroups +*/ + +// isArray +type ServerGetSecurityGroupsAttributeType = *[]string +type ServerGetSecurityGroupsArgType = []string +type ServerGetSecurityGroupsRetType = []string + +func getServerGetSecurityGroupsAttributeTypeOk(arg ServerGetSecurityGroupsAttributeType) (ret ServerGetSecurityGroupsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetSecurityGroupsAttributeType(arg *ServerGetSecurityGroupsAttributeType, val ServerGetSecurityGroupsRetType) { + *arg = &val +} + +/* + types and functions for serviceAccountMails +*/ + +// isArray +type ServerGetServiceAccountMailsAttributeType = *[]string +type ServerGetServiceAccountMailsArgType = []string +type ServerGetServiceAccountMailsRetType = []string + +func getServerGetServiceAccountMailsAttributeTypeOk(arg ServerGetServiceAccountMailsAttributeType) (ret ServerGetServiceAccountMailsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetServiceAccountMailsAttributeType(arg *ServerGetServiceAccountMailsAttributeType, val ServerGetServiceAccountMailsRetType) { + *arg = &val +} + +/* + types and functions for status +*/ + +// isNotNullableString +type ServerGetStatusAttributeType = *string + +func getServerGetStatusAttributeTypeOk(arg ServerGetStatusAttributeType) (ret ServerGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetStatusAttributeType(arg *ServerGetStatusAttributeType, val ServerGetStatusRetType) { + *arg = &val +} + +type ServerGetStatusArgType = string +type ServerGetStatusRetType = string + +/* + types and functions for updatedAt +*/ + +// isDateTime +type ServerGetUpdatedAtAttributeType = *time.Time +type ServerGetUpdatedAtArgType = time.Time +type ServerGetUpdatedAtRetType = time.Time + +func getServerGetUpdatedAtAttributeTypeOk(arg ServerGetUpdatedAtAttributeType) (ret ServerGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetUpdatedAtAttributeType(arg *ServerGetUpdatedAtAttributeType, val ServerGetUpdatedAtRetType) { + *arg = &val +} + +/* + types and functions for userData +*/ + +// isByteArray +type ServerGetUserDataAttributeType = *[]byte +type ServerGetUserDataArgType = []byte +type ServerGetUserDataRetType = []byte + +func getServerGetUserDataAttributeTypeOk(arg ServerGetUserDataAttributeType) (ret ServerGetUserDataRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetUserDataAttributeType(arg *ServerGetUserDataAttributeType, val ServerGetUserDataRetType) { + *arg = &val +} + +/* + types and functions for volumes +*/ + +// isArray +type ServerGetVolumesAttributeType = *[]string +type ServerGetVolumesArgType = []string +type ServerGetVolumesRetType = []string + +func getServerGetVolumesAttributeTypeOk(arg ServerGetVolumesAttributeType) (ret ServerGetVolumesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetVolumesAttributeType(arg *ServerGetVolumesAttributeType, val ServerGetVolumesRetType) { + *arg = &val +} + // Server Representation of a single server object. type Server struct { // Universally Unique Identifier (UUID). - AffinityGroup *string `json:"affinityGroup,omitempty"` + AffinityGroup ServerGetAffinityGroupAttributeType `json:"affinityGroup,omitempty"` // Object that represents an availability zone. - AvailabilityZone *string `json:"availabilityZone,omitempty"` - BootVolume *CreateServerPayloadBootVolume `json:"bootVolume,omitempty"` + AvailabilityZone ServerGetAvailabilityZoneAttributeType `json:"availabilityZone,omitempty"` + BootVolume ServerGetBootVolumeAttributeType `json:"bootVolume,omitempty"` // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt ServerGetCreatedAtAttributeType `json:"createdAt,omitempty"` // An error message. - ErrorMessage *string `json:"errorMessage,omitempty"` + ErrorMessage ServerGetErrorMessageAttributeType `json:"errorMessage,omitempty"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id ServerGetIdAttributeType `json:"id,omitempty"` // Universally Unique Identifier (UUID). - ImageId *string `json:"imageId,omitempty"` + ImageId ServerGetImageIdAttributeType `json:"imageId,omitempty"` // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. - KeypairName *string `json:"keypairName,omitempty"` + KeypairName ServerGetKeypairNameAttributeType `json:"keypairName,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels ServerGetLabelsAttributeType `json:"labels,omitempty"` // Date-time when resource was launched. - LaunchedAt *time.Time `json:"launchedAt,omitempty"` + LaunchedAt ServerGetLaunchedAtAttributeType `json:"launchedAt,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED - MachineType *string `json:"machineType"` - MaintenanceWindow *ServerMaintenance `json:"maintenanceWindow,omitempty"` + MachineType ServerGetMachineTypeAttributeType `json:"machineType"` + MaintenanceWindow ServerGetMaintenanceWindowAttributeType `json:"maintenanceWindow,omitempty"` // The name for a Server. // REQUIRED - Name *string `json:"name"` - Networking *CreateServerPayloadNetworking `json:"networking,omitempty"` + Name ServerGetNameAttributeType `json:"name"` + Networking ServerGetNetworkingAttributeType `json:"networking,omitempty"` // A list of networks attached to a server. - Nics *[]ServerNetwork `json:"nics,omitempty"` + Nics ServerGetNicsAttributeType `json:"nics,omitempty"` // The power status of a server. Possible values: `CRASHED`, `ERROR`, `RUNNING`, `STOPPED`. - PowerStatus *string `json:"powerStatus,omitempty"` + PowerStatus ServerGetPowerStatusAttributeType `json:"powerStatus,omitempty"` // A list of General Objects. - SecurityGroups *[]string `json:"securityGroups,omitempty"` + SecurityGroups ServerGetSecurityGroupsAttributeType `json:"securityGroups,omitempty"` // A list of service account mails. - ServiceAccountMails *[]string `json:"serviceAccountMails,omitempty"` + ServiceAccountMails ServerGetServiceAccountMailsAttributeType `json:"serviceAccountMails,omitempty"` // The status of a server object. Possible values: `ACTIVE`, `BACKING-UP`, `CREATING`, `DEALLOCATED`, `DEALLOCATING`, `DELETED`, `DELETING`, `ERROR`, `INACTIVE`, `MIGRATING`, `REBOOT`, `REBOOTING`, `REBUILD`, `REBUILDING`, `RESCUE`, `RESCUING`, `RESIZING`, `RESTORING`, `SNAPSHOTTING`, `STARTING`, `STOPPING`, `UNRESCUING`, `UPDATING`. - Status *string `json:"status,omitempty"` + Status ServerGetStatusAttributeType `json:"status,omitempty"` // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAt ServerGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` // User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init to the server. - UserData *string `json:"userData,omitempty"` + UserData ServerGetUserDataAttributeType `json:"userData,omitempty"` // A list of UUIDs. - Volumes *[]string `json:"volumes,omitempty"` + Volumes ServerGetVolumesAttributeType `json:"volumes,omitempty"` } type _Server Server @@ -71,10 +521,10 @@ type _Server Server // 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 NewServer(machineType *string, name *string) *Server { +func NewServer(machineType ServerGetMachineTypeArgType, name ServerGetNameArgType) *Server { this := Server{} - this.MachineType = machineType - this.Name = name + setServerGetMachineTypeAttributeType(&this.MachineType, machineType) + setServerGetNameAttributeType(&this.Name, name) return &this } @@ -87,756 +537,566 @@ func NewServerWithDefaults() *Server { } // GetAffinityGroup returns the AffinityGroup field value if set, zero value otherwise. -func (o *Server) GetAffinityGroup() *string { - if o == nil || IsNil(o.AffinityGroup) { - var ret *string - return ret - } - return o.AffinityGroup +func (o *Server) GetAffinityGroup() (res ServerGetAffinityGroupRetType) { + res, _ = o.GetAffinityGroupOk() + return } // GetAffinityGroupOk returns a tuple with the AffinityGroup field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Server) GetAffinityGroupOk() (*string, bool) { - if o == nil || IsNil(o.AffinityGroup) { - return nil, false - } - return o.AffinityGroup, true +func (o *Server) GetAffinityGroupOk() (ret ServerGetAffinityGroupRetType, ok bool) { + return getServerGetAffinityGroupAttributeTypeOk(o.AffinityGroup) } // HasAffinityGroup returns a boolean if a field has been set. func (o *Server) HasAffinityGroup() bool { - if o != nil && !IsNil(o.AffinityGroup) { - return true - } - - return false + _, ok := o.GetAffinityGroupOk() + return ok } // SetAffinityGroup gets a reference to the given string and assigns it to the AffinityGroup field. -func (o *Server) SetAffinityGroup(v *string) { - o.AffinityGroup = v +func (o *Server) SetAffinityGroup(v ServerGetAffinityGroupRetType) { + setServerGetAffinityGroupAttributeType(&o.AffinityGroup, v) } // GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. -func (o *Server) GetAvailabilityZone() *string { - if o == nil || IsNil(o.AvailabilityZone) { - var ret *string - return ret - } - return o.AvailabilityZone +func (o *Server) GetAvailabilityZone() (res ServerGetAvailabilityZoneRetType) { + res, _ = o.GetAvailabilityZoneOk() + return } // GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Server) GetAvailabilityZoneOk() (*string, bool) { - if o == nil || IsNil(o.AvailabilityZone) { - return nil, false - } - return o.AvailabilityZone, true +func (o *Server) GetAvailabilityZoneOk() (ret ServerGetAvailabilityZoneRetType, ok bool) { + return getServerGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) } // HasAvailabilityZone returns a boolean if a field has been set. func (o *Server) HasAvailabilityZone() bool { - if o != nil && !IsNil(o.AvailabilityZone) { - return true - } - - return false + _, ok := o.GetAvailabilityZoneOk() + return ok } // SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. -func (o *Server) SetAvailabilityZone(v *string) { - o.AvailabilityZone = v +func (o *Server) SetAvailabilityZone(v ServerGetAvailabilityZoneRetType) { + setServerGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) } // GetBootVolume returns the BootVolume field value if set, zero value otherwise. -func (o *Server) GetBootVolume() *CreateServerPayloadBootVolume { - if o == nil || IsNil(o.BootVolume) { - var ret *CreateServerPayloadBootVolume - return ret - } - return o.BootVolume +func (o *Server) GetBootVolume() (res ServerGetBootVolumeRetType) { + res, _ = o.GetBootVolumeOk() + return } // GetBootVolumeOk returns a tuple with the BootVolume field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Server) GetBootVolumeOk() (*CreateServerPayloadBootVolume, bool) { - if o == nil || IsNil(o.BootVolume) { - return nil, false - } - return o.BootVolume, true +func (o *Server) GetBootVolumeOk() (ret ServerGetBootVolumeRetType, ok bool) { + return getServerGetBootVolumeAttributeTypeOk(o.BootVolume) } // HasBootVolume returns a boolean if a field has been set. func (o *Server) HasBootVolume() bool { - if o != nil && !IsNil(o.BootVolume) { - return true - } - - return false + _, ok := o.GetBootVolumeOk() + return ok } // SetBootVolume gets a reference to the given CreateServerPayloadBootVolume and assigns it to the BootVolume field. -func (o *Server) SetBootVolume(v *CreateServerPayloadBootVolume) { - o.BootVolume = v +func (o *Server) SetBootVolume(v ServerGetBootVolumeRetType) { + setServerGetBootVolumeAttributeType(&o.BootVolume, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *Server) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - return o.CreatedAt +func (o *Server) GetCreatedAt() (res ServerGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return } // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Server) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true +func (o *Server) GetCreatedAtOk() (ret ServerGetCreatedAtRetType, ok bool) { + return getServerGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. func (o *Server) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false + _, ok := o.GetCreatedAtOk() + return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *Server) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *Server) SetCreatedAt(v ServerGetCreatedAtRetType) { + setServerGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. -func (o *Server) GetErrorMessage() *string { - if o == nil || IsNil(o.ErrorMessage) { - var ret *string - return ret - } - return o.ErrorMessage +func (o *Server) GetErrorMessage() (res ServerGetErrorMessageRetType) { + res, _ = o.GetErrorMessageOk() + return } // GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Server) GetErrorMessageOk() (*string, bool) { - if o == nil || IsNil(o.ErrorMessage) { - return nil, false - } - return o.ErrorMessage, true +func (o *Server) GetErrorMessageOk() (ret ServerGetErrorMessageRetType, ok bool) { + return getServerGetErrorMessageAttributeTypeOk(o.ErrorMessage) } // HasErrorMessage returns a boolean if a field has been set. func (o *Server) HasErrorMessage() bool { - if o != nil && !IsNil(o.ErrorMessage) { - return true - } - - return false + _, ok := o.GetErrorMessageOk() + return ok } // SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. -func (o *Server) SetErrorMessage(v *string) { - o.ErrorMessage = v +func (o *Server) SetErrorMessage(v ServerGetErrorMessageRetType) { + setServerGetErrorMessageAttributeType(&o.ErrorMessage, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *Server) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *Server) GetId() (res ServerGetIdRetType) { + 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 *Server) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *Server) GetIdOk() (ret ServerGetIdRetType, ok bool) { + return getServerGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *Server) 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 *Server) SetId(v *string) { - o.Id = v +func (o *Server) SetId(v ServerGetIdRetType) { + setServerGetIdAttributeType(&o.Id, v) } // GetImageId returns the ImageId field value if set, zero value otherwise. -func (o *Server) GetImageId() *string { - if o == nil || IsNil(o.ImageId) { - var ret *string - return ret - } - return o.ImageId +func (o *Server) GetImageId() (res ServerGetImageIdRetType) { + res, _ = o.GetImageIdOk() + return } // GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Server) GetImageIdOk() (*string, bool) { - if o == nil || IsNil(o.ImageId) { - return nil, false - } - return o.ImageId, true +func (o *Server) GetImageIdOk() (ret ServerGetImageIdRetType, ok bool) { + return getServerGetImageIdAttributeTypeOk(o.ImageId) } // HasImageId returns a boolean if a field has been set. func (o *Server) HasImageId() bool { - if o != nil && !IsNil(o.ImageId) { - return true - } - - return false + _, ok := o.GetImageIdOk() + return ok } // SetImageId gets a reference to the given string and assigns it to the ImageId field. -func (o *Server) SetImageId(v *string) { - o.ImageId = v +func (o *Server) SetImageId(v ServerGetImageIdRetType) { + setServerGetImageIdAttributeType(&o.ImageId, v) } // GetKeypairName returns the KeypairName field value if set, zero value otherwise. -func (o *Server) GetKeypairName() *string { - if o == nil || IsNil(o.KeypairName) { - var ret *string - return ret - } - return o.KeypairName +func (o *Server) GetKeypairName() (res ServerGetKeypairNameRetType) { + res, _ = o.GetKeypairNameOk() + return } // GetKeypairNameOk returns a tuple with the KeypairName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Server) GetKeypairNameOk() (*string, bool) { - if o == nil || IsNil(o.KeypairName) { - return nil, false - } - return o.KeypairName, true +func (o *Server) GetKeypairNameOk() (ret ServerGetKeypairNameRetType, ok bool) { + return getServerGetKeypairNameAttributeTypeOk(o.KeypairName) } // HasKeypairName returns a boolean if a field has been set. func (o *Server) HasKeypairName() bool { - if o != nil && !IsNil(o.KeypairName) { - return true - } - - return false + _, ok := o.GetKeypairNameOk() + return ok } // SetKeypairName gets a reference to the given string and assigns it to the KeypairName field. -func (o *Server) SetKeypairName(v *string) { - o.KeypairName = v +func (o *Server) SetKeypairName(v ServerGetKeypairNameRetType) { + setServerGetKeypairNameAttributeType(&o.KeypairName, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *Server) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *Server) GetLabels() (res ServerGetLabelsRetType) { + 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 *Server) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *Server) GetLabelsOk() (ret ServerGetLabelsRetType, ok bool) { + return getServerGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *Server) 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 *Server) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *Server) SetLabels(v ServerGetLabelsRetType) { + setServerGetLabelsAttributeType(&o.Labels, v) } // GetLaunchedAt returns the LaunchedAt field value if set, zero value otherwise. -func (o *Server) GetLaunchedAt() *time.Time { - if o == nil || IsNil(o.LaunchedAt) { - var ret *time.Time - return ret - } - return o.LaunchedAt +func (o *Server) GetLaunchedAt() (res ServerGetLaunchedAtRetType) { + res, _ = o.GetLaunchedAtOk() + return } // GetLaunchedAtOk returns a tuple with the LaunchedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Server) GetLaunchedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.LaunchedAt) { - return nil, false - } - return o.LaunchedAt, true +func (o *Server) GetLaunchedAtOk() (ret ServerGetLaunchedAtRetType, ok bool) { + return getServerGetLaunchedAtAttributeTypeOk(o.LaunchedAt) } // HasLaunchedAt returns a boolean if a field has been set. func (o *Server) HasLaunchedAt() bool { - if o != nil && !IsNil(o.LaunchedAt) { - return true - } - - return false + _, ok := o.GetLaunchedAtOk() + return ok } // SetLaunchedAt gets a reference to the given time.Time and assigns it to the LaunchedAt field. -func (o *Server) SetLaunchedAt(v *time.Time) { - o.LaunchedAt = v +func (o *Server) SetLaunchedAt(v ServerGetLaunchedAtRetType) { + setServerGetLaunchedAtAttributeType(&o.LaunchedAt, v) } // GetMachineType returns the MachineType field value -func (o *Server) GetMachineType() *string { - if o == nil || IsNil(o.MachineType) { - var ret *string - return ret - } - - return o.MachineType +func (o *Server) GetMachineType() (ret ServerGetMachineTypeRetType) { + ret, _ = o.GetMachineTypeOk() + return ret } // GetMachineTypeOk returns a tuple with the MachineType field value // and a boolean to check if the value has been set. -func (o *Server) GetMachineTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.MachineType, true +func (o *Server) GetMachineTypeOk() (ret ServerGetMachineTypeRetType, ok bool) { + return getServerGetMachineTypeAttributeTypeOk(o.MachineType) } // SetMachineType sets field value -func (o *Server) SetMachineType(v *string) { - o.MachineType = v +func (o *Server) SetMachineType(v ServerGetMachineTypeRetType) { + setServerGetMachineTypeAttributeType(&o.MachineType, v) } // GetMaintenanceWindow returns the MaintenanceWindow field value if set, zero value otherwise. -func (o *Server) GetMaintenanceWindow() *ServerMaintenance { - if o == nil || IsNil(o.MaintenanceWindow) { - var ret *ServerMaintenance - return ret - } - return o.MaintenanceWindow +func (o *Server) GetMaintenanceWindow() (res ServerGetMaintenanceWindowRetType) { + res, _ = o.GetMaintenanceWindowOk() + return } // GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Server) GetMaintenanceWindowOk() (*ServerMaintenance, bool) { - if o == nil || IsNil(o.MaintenanceWindow) { - return nil, false - } - return o.MaintenanceWindow, true +func (o *Server) GetMaintenanceWindowOk() (ret ServerGetMaintenanceWindowRetType, ok bool) { + return getServerGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow) } // HasMaintenanceWindow returns a boolean if a field has been set. func (o *Server) HasMaintenanceWindow() bool { - if o != nil && !IsNil(o.MaintenanceWindow) { - return true - } - - return false + _, ok := o.GetMaintenanceWindowOk() + return ok } // SetMaintenanceWindow gets a reference to the given ServerMaintenance and assigns it to the MaintenanceWindow field. -func (o *Server) SetMaintenanceWindow(v *ServerMaintenance) { - o.MaintenanceWindow = v +func (o *Server) SetMaintenanceWindow(v ServerGetMaintenanceWindowRetType) { + setServerGetMaintenanceWindowAttributeType(&o.MaintenanceWindow, v) } // GetName returns the Name field value -func (o *Server) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *Server) GetName() (ret ServerGetNameRetType) { + 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 *Server) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *Server) GetNameOk() (ret ServerGetNameRetType, ok bool) { + return getServerGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *Server) SetName(v *string) { - o.Name = v +func (o *Server) SetName(v ServerGetNameRetType) { + setServerGetNameAttributeType(&o.Name, v) } // GetNetworking returns the Networking field value if set, zero value otherwise. -func (o *Server) GetNetworking() *CreateServerPayloadNetworking { - if o == nil || IsNil(o.Networking) { - var ret *CreateServerPayloadNetworking - return ret - } - return o.Networking +func (o *Server) GetNetworking() (res ServerGetNetworkingRetType) { + res, _ = o.GetNetworkingOk() + return } // GetNetworkingOk returns a tuple with the Networking field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Server) GetNetworkingOk() (*CreateServerPayloadNetworking, bool) { - if o == nil || IsNil(o.Networking) { - return nil, false - } - return o.Networking, true +func (o *Server) GetNetworkingOk() (ret ServerGetNetworkingRetType, ok bool) { + return getServerGetNetworkingAttributeTypeOk(o.Networking) } // HasNetworking returns a boolean if a field has been set. func (o *Server) HasNetworking() bool { - if o != nil && !IsNil(o.Networking) { - return true - } - - return false + _, ok := o.GetNetworkingOk() + return ok } // SetNetworking gets a reference to the given CreateServerPayloadNetworking and assigns it to the Networking field. -func (o *Server) SetNetworking(v *CreateServerPayloadNetworking) { - o.Networking = v +func (o *Server) SetNetworking(v ServerGetNetworkingRetType) { + setServerGetNetworkingAttributeType(&o.Networking, v) } // GetNics returns the Nics field value if set, zero value otherwise. -func (o *Server) GetNics() *[]ServerNetwork { - if o == nil || IsNil(o.Nics) { - var ret *[]ServerNetwork - return ret - } - return o.Nics +func (o *Server) GetNics() (res ServerGetNicsRetType) { + res, _ = o.GetNicsOk() + return } // GetNicsOk returns a tuple with the Nics field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Server) GetNicsOk() (*[]ServerNetwork, bool) { - if o == nil || IsNil(o.Nics) { - return nil, false - } - return o.Nics, true +func (o *Server) GetNicsOk() (ret ServerGetNicsRetType, ok bool) { + return getServerGetNicsAttributeTypeOk(o.Nics) } // HasNics returns a boolean if a field has been set. func (o *Server) HasNics() bool { - if o != nil && !IsNil(o.Nics) { - return true - } - - return false + _, ok := o.GetNicsOk() + return ok } // SetNics gets a reference to the given []ServerNetwork and assigns it to the Nics field. -func (o *Server) SetNics(v *[]ServerNetwork) { - o.Nics = v +func (o *Server) SetNics(v ServerGetNicsRetType) { + setServerGetNicsAttributeType(&o.Nics, v) } // GetPowerStatus returns the PowerStatus field value if set, zero value otherwise. -func (o *Server) GetPowerStatus() *string { - if o == nil || IsNil(o.PowerStatus) { - var ret *string - return ret - } - return o.PowerStatus +func (o *Server) GetPowerStatus() (res ServerGetPowerStatusRetType) { + res, _ = o.GetPowerStatusOk() + return } // GetPowerStatusOk returns a tuple with the PowerStatus field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Server) GetPowerStatusOk() (*string, bool) { - if o == nil || IsNil(o.PowerStatus) { - return nil, false - } - return o.PowerStatus, true +func (o *Server) GetPowerStatusOk() (ret ServerGetPowerStatusRetType, ok bool) { + return getServerGetPowerStatusAttributeTypeOk(o.PowerStatus) } // HasPowerStatus returns a boolean if a field has been set. func (o *Server) HasPowerStatus() bool { - if o != nil && !IsNil(o.PowerStatus) { - return true - } - - return false + _, ok := o.GetPowerStatusOk() + return ok } // SetPowerStatus gets a reference to the given string and assigns it to the PowerStatus field. -func (o *Server) SetPowerStatus(v *string) { - o.PowerStatus = v +func (o *Server) SetPowerStatus(v ServerGetPowerStatusRetType) { + setServerGetPowerStatusAttributeType(&o.PowerStatus, v) } // GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. -func (o *Server) GetSecurityGroups() *[]string { - if o == nil || IsNil(o.SecurityGroups) { - var ret *[]string - return ret - } - return o.SecurityGroups +func (o *Server) GetSecurityGroups() (res ServerGetSecurityGroupsRetType) { + res, _ = o.GetSecurityGroupsOk() + return } // GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Server) GetSecurityGroupsOk() (*[]string, bool) { - if o == nil || IsNil(o.SecurityGroups) { - return nil, false - } - return o.SecurityGroups, true +func (o *Server) GetSecurityGroupsOk() (ret ServerGetSecurityGroupsRetType, ok bool) { + return getServerGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) } // HasSecurityGroups returns a boolean if a field has been set. func (o *Server) HasSecurityGroups() bool { - if o != nil && !IsNil(o.SecurityGroups) { - return true - } - - return false + _, ok := o.GetSecurityGroupsOk() + return ok } // SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. -func (o *Server) SetSecurityGroups(v *[]string) { - o.SecurityGroups = v +func (o *Server) SetSecurityGroups(v ServerGetSecurityGroupsRetType) { + setServerGetSecurityGroupsAttributeType(&o.SecurityGroups, v) } // GetServiceAccountMails returns the ServiceAccountMails field value if set, zero value otherwise. -func (o *Server) GetServiceAccountMails() *[]string { - if o == nil || IsNil(o.ServiceAccountMails) { - var ret *[]string - return ret - } - return o.ServiceAccountMails +func (o *Server) GetServiceAccountMails() (res ServerGetServiceAccountMailsRetType) { + res, _ = o.GetServiceAccountMailsOk() + return } // GetServiceAccountMailsOk returns a tuple with the ServiceAccountMails field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Server) GetServiceAccountMailsOk() (*[]string, bool) { - if o == nil || IsNil(o.ServiceAccountMails) { - return nil, false - } - return o.ServiceAccountMails, true +func (o *Server) GetServiceAccountMailsOk() (ret ServerGetServiceAccountMailsRetType, ok bool) { + return getServerGetServiceAccountMailsAttributeTypeOk(o.ServiceAccountMails) } // HasServiceAccountMails returns a boolean if a field has been set. func (o *Server) HasServiceAccountMails() bool { - if o != nil && !IsNil(o.ServiceAccountMails) { - return true - } - - return false + _, ok := o.GetServiceAccountMailsOk() + return ok } // SetServiceAccountMails gets a reference to the given []string and assigns it to the ServiceAccountMails field. -func (o *Server) SetServiceAccountMails(v *[]string) { - o.ServiceAccountMails = v +func (o *Server) SetServiceAccountMails(v ServerGetServiceAccountMailsRetType) { + setServerGetServiceAccountMailsAttributeType(&o.ServiceAccountMails, v) } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *Server) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - return o.Status +func (o *Server) GetStatus() (res ServerGetStatusRetType) { + 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 *Server) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true +func (o *Server) GetStatusOk() (ret ServerGetStatusRetType, ok bool) { + return getServerGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. func (o *Server) 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 *Server) SetStatus(v *string) { - o.Status = v +func (o *Server) SetStatus(v ServerGetStatusRetType) { + setServerGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *Server) GetUpdatedAt() *time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret *time.Time - return ret - } - return o.UpdatedAt +func (o *Server) GetUpdatedAt() (res ServerGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Server) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true +func (o *Server) GetUpdatedAtOk() (ret ServerGetUpdatedAtRetType, ok bool) { + return getServerGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. func (o *Server) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false + _, ok := o.GetUpdatedAtOk() + return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *Server) SetUpdatedAt(v *time.Time) { - o.UpdatedAt = v +func (o *Server) SetUpdatedAt(v ServerGetUpdatedAtRetType) { + setServerGetUpdatedAtAttributeType(&o.UpdatedAt, v) } // GetUserData returns the UserData field value if set, zero value otherwise. -func (o *Server) GetUserData() *string { - if o == nil || IsNil(o.UserData) { - var ret *string - return ret - } - return o.UserData +func (o *Server) GetUserData() (res ServerGetUserDataRetType) { + res, _ = o.GetUserDataOk() + return } // GetUserDataOk returns a tuple with the UserData field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Server) GetUserDataOk() (*string, bool) { - if o == nil || IsNil(o.UserData) { - return nil, false - } - return o.UserData, true +func (o *Server) GetUserDataOk() (ret ServerGetUserDataRetType, ok bool) { + return getServerGetUserDataAttributeTypeOk(o.UserData) } // HasUserData returns a boolean if a field has been set. func (o *Server) HasUserData() bool { - if o != nil && !IsNil(o.UserData) { - return true - } - - return false + _, ok := o.GetUserDataOk() + return ok } // SetUserData gets a reference to the given string and assigns it to the UserData field. -func (o *Server) SetUserData(v *string) { - o.UserData = v +func (o *Server) SetUserData(v ServerGetUserDataRetType) { + setServerGetUserDataAttributeType(&o.UserData, v) } // GetVolumes returns the Volumes field value if set, zero value otherwise. -func (o *Server) GetVolumes() *[]string { - if o == nil || IsNil(o.Volumes) { - var ret *[]string - return ret - } - return o.Volumes +func (o *Server) GetVolumes() (res ServerGetVolumesRetType) { + res, _ = o.GetVolumesOk() + return } // GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Server) GetVolumesOk() (*[]string, bool) { - if o == nil || IsNil(o.Volumes) { - return nil, false - } - return o.Volumes, true +func (o *Server) GetVolumesOk() (ret ServerGetVolumesRetType, ok bool) { + return getServerGetVolumesAttributeTypeOk(o.Volumes) } // HasVolumes returns a boolean if a field has been set. func (o *Server) HasVolumes() bool { - if o != nil && !IsNil(o.Volumes) { - return true - } - - return false + _, ok := o.GetVolumesOk() + return ok } // SetVolumes gets a reference to the given []string and assigns it to the Volumes field. -func (o *Server) SetVolumes(v *[]string) { - o.Volumes = v +func (o *Server) SetVolumes(v ServerGetVolumesRetType) { + setServerGetVolumesAttributeType(&o.Volumes, v) } func (o Server) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.AffinityGroup) { - toSerialize["affinityGroup"] = o.AffinityGroup + if val, ok := getServerGetAffinityGroupAttributeTypeOk(o.AffinityGroup); ok { + toSerialize["AffinityGroup"] = val + } + if val, ok := getServerGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { + toSerialize["AvailabilityZone"] = val + } + if val, ok := getServerGetBootVolumeAttributeTypeOk(o.BootVolume); ok { + toSerialize["BootVolume"] = val } - if !IsNil(o.AvailabilityZone) { - toSerialize["availabilityZone"] = o.AvailabilityZone + if val, ok := getServerGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val } - if !IsNil(o.BootVolume) { - toSerialize["bootVolume"] = o.BootVolume + if val, ok := getServerGetErrorMessageAttributeTypeOk(o.ErrorMessage); ok { + toSerialize["ErrorMessage"] = val } - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt + if val, ok := getServerGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.ErrorMessage) { - toSerialize["errorMessage"] = o.ErrorMessage + if val, ok := getServerGetImageIdAttributeTypeOk(o.ImageId); ok { + toSerialize["ImageId"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getServerGetKeypairNameAttributeTypeOk(o.KeypairName); ok { + toSerialize["KeypairName"] = val } - if !IsNil(o.ImageId) { - toSerialize["imageId"] = o.ImageId + if val, ok := getServerGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.KeypairName) { - toSerialize["keypairName"] = o.KeypairName + if val, ok := getServerGetLaunchedAtAttributeTypeOk(o.LaunchedAt); ok { + toSerialize["LaunchedAt"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getServerGetMachineTypeAttributeTypeOk(o.MachineType); ok { + toSerialize["MachineType"] = val } - if !IsNil(o.LaunchedAt) { - toSerialize["launchedAt"] = o.LaunchedAt + if val, ok := getServerGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow); ok { + toSerialize["MaintenanceWindow"] = val } - toSerialize["machineType"] = o.MachineType - if !IsNil(o.MaintenanceWindow) { - toSerialize["maintenanceWindow"] = o.MaintenanceWindow + if val, ok := getServerGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - toSerialize["name"] = o.Name - if !IsNil(o.Networking) { - toSerialize["networking"] = o.Networking + if val, ok := getServerGetNetworkingAttributeTypeOk(o.Networking); ok { + toSerialize["Networking"] = val } - if !IsNil(o.Nics) { - toSerialize["nics"] = o.Nics + if val, ok := getServerGetNicsAttributeTypeOk(o.Nics); ok { + toSerialize["Nics"] = val } - if !IsNil(o.PowerStatus) { - toSerialize["powerStatus"] = o.PowerStatus + if val, ok := getServerGetPowerStatusAttributeTypeOk(o.PowerStatus); ok { + toSerialize["PowerStatus"] = val } - if !IsNil(o.SecurityGroups) { - toSerialize["securityGroups"] = o.SecurityGroups + if val, ok := getServerGetSecurityGroupsAttributeTypeOk(o.SecurityGroups); ok { + toSerialize["SecurityGroups"] = val } - if !IsNil(o.ServiceAccountMails) { - toSerialize["serviceAccountMails"] = o.ServiceAccountMails + if val, ok := getServerGetServiceAccountMailsAttributeTypeOk(o.ServiceAccountMails); ok { + toSerialize["ServiceAccountMails"] = val } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status + if val, ok := getServerGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt + if val, ok := getServerGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val } - if !IsNil(o.UserData) { - toSerialize["userData"] = o.UserData + if val, ok := getServerGetUserDataAttributeTypeOk(o.UserData); ok { + toSerialize["UserData"] = val } - if !IsNil(o.Volumes) { - toSerialize["volumes"] = o.Volumes + if val, ok := getServerGetVolumesAttributeTypeOk(o.Volumes); ok { + toSerialize["Volumes"] = val } return toSerialize, nil } diff --git a/services/iaas/model_server_console_url.go b/services/iaas/model_server_console_url.go index e86c3ce07..46ac315be 100644 --- a/services/iaas/model_server_console_url.go +++ b/services/iaas/model_server_console_url.go @@ -17,10 +17,31 @@ import ( // checks if the ServerConsoleUrl type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ServerConsoleUrl{} +/* + types and functions for url +*/ + +// isNotNullableString +type ServerConsoleUrlGetUrlAttributeType = *string + +func getServerConsoleUrlGetUrlAttributeTypeOk(arg ServerConsoleUrlGetUrlAttributeType) (ret ServerConsoleUrlGetUrlRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerConsoleUrlGetUrlAttributeType(arg *ServerConsoleUrlGetUrlAttributeType, val ServerConsoleUrlGetUrlRetType) { + *arg = &val +} + +type ServerConsoleUrlGetUrlArgType = string +type ServerConsoleUrlGetUrlRetType = string + // ServerConsoleUrl Object that represents a server console URL. type ServerConsoleUrl struct { // REQUIRED - Url *string `json:"url"` + Url ServerConsoleUrlGetUrlAttributeType `json:"url"` } type _ServerConsoleUrl ServerConsoleUrl @@ -29,9 +50,9 @@ type _ServerConsoleUrl ServerConsoleUrl // 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 NewServerConsoleUrl(url *string) *ServerConsoleUrl { +func NewServerConsoleUrl(url ServerConsoleUrlGetUrlArgType) *ServerConsoleUrl { this := ServerConsoleUrl{} - this.Url = url + setServerConsoleUrlGetUrlAttributeType(&this.Url, url) return &this } @@ -44,32 +65,27 @@ func NewServerConsoleUrlWithDefaults() *ServerConsoleUrl { } // GetUrl returns the Url field value -func (o *ServerConsoleUrl) GetUrl() *string { - if o == nil || IsNil(o.Url) { - var ret *string - return ret - } - - return o.Url +func (o *ServerConsoleUrl) GetUrl() (ret ServerConsoleUrlGetUrlRetType) { + ret, _ = o.GetUrlOk() + return ret } // GetUrlOk returns a tuple with the Url field value // and a boolean to check if the value has been set. -func (o *ServerConsoleUrl) GetUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Url, true +func (o *ServerConsoleUrl) GetUrlOk() (ret ServerConsoleUrlGetUrlRetType, ok bool) { + return getServerConsoleUrlGetUrlAttributeTypeOk(o.Url) } // SetUrl sets field value -func (o *ServerConsoleUrl) SetUrl(v *string) { - o.Url = v +func (o *ServerConsoleUrl) SetUrl(v ServerConsoleUrlGetUrlRetType) { + setServerConsoleUrlGetUrlAttributeType(&o.Url, v) } func (o ServerConsoleUrl) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["url"] = o.Url + if val, ok := getServerConsoleUrlGetUrlAttributeTypeOk(o.Url); ok { + toSerialize["Url"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_server_list_response.go b/services/iaas/model_server_list_response.go index 7c501b914..71dcac947 100644 --- a/services/iaas/model_server_list_response.go +++ b/services/iaas/model_server_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the ServerListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ServerListResponse{} +/* + types and functions for items +*/ + +// isArray +type ServerListResponseGetItemsAttributeType = *[]Server +type ServerListResponseGetItemsArgType = []Server +type ServerListResponseGetItemsRetType = []Server + +func getServerListResponseGetItemsAttributeTypeOk(arg ServerListResponseGetItemsAttributeType) (ret ServerListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerListResponseGetItemsAttributeType(arg *ServerListResponseGetItemsAttributeType, val ServerListResponseGetItemsRetType) { + *arg = &val +} + // ServerListResponse Response object for server list request. type ServerListResponse struct { // A list of servers. // REQUIRED - Items *[]Server `json:"items"` + Items ServerListResponseGetItemsAttributeType `json:"items"` } type _ServerListResponse ServerListResponse @@ -30,9 +50,9 @@ type _ServerListResponse ServerListResponse // 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 NewServerListResponse(items *[]Server) *ServerListResponse { +func NewServerListResponse(items ServerListResponseGetItemsArgType) *ServerListResponse { this := ServerListResponse{} - this.Items = items + setServerListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewServerListResponseWithDefaults() *ServerListResponse { } // GetItems returns the Items field value -func (o *ServerListResponse) GetItems() *[]Server { - if o == nil || IsNil(o.Items) { - var ret *[]Server - return ret - } - - return o.Items +func (o *ServerListResponse) GetItems() (ret ServerListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *ServerListResponse) GetItemsOk() (*[]Server, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *ServerListResponse) GetItemsOk() (ret ServerListResponseGetItemsRetType, ok bool) { + return getServerListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *ServerListResponse) SetItems(v *[]Server) { - o.Items = v +func (o *ServerListResponse) SetItems(v ServerListResponseGetItemsRetType) { + setServerListResponseGetItemsAttributeType(&o.Items, v) } func (o ServerListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getServerListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_server_maintenance.go b/services/iaas/model_server_maintenance.go index 00d1fd56f..bee76a9ed 100644 --- a/services/iaas/model_server_maintenance.go +++ b/services/iaas/model_server_maintenance.go @@ -18,17 +18,99 @@ import ( // checks if the ServerMaintenance type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ServerMaintenance{} +/* + types and functions for details +*/ + +// isNotNullableString +type ServerMaintenanceGetDetailsAttributeType = *string + +func getServerMaintenanceGetDetailsAttributeTypeOk(arg ServerMaintenanceGetDetailsAttributeType) (ret ServerMaintenanceGetDetailsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerMaintenanceGetDetailsAttributeType(arg *ServerMaintenanceGetDetailsAttributeType, val ServerMaintenanceGetDetailsRetType) { + *arg = &val +} + +type ServerMaintenanceGetDetailsArgType = string +type ServerMaintenanceGetDetailsRetType = string + +/* + types and functions for endsAt +*/ + +// isDateTime +type ServerMaintenanceGetEndsAtAttributeType = *time.Time +type ServerMaintenanceGetEndsAtArgType = time.Time +type ServerMaintenanceGetEndsAtRetType = time.Time + +func getServerMaintenanceGetEndsAtAttributeTypeOk(arg ServerMaintenanceGetEndsAtAttributeType) (ret ServerMaintenanceGetEndsAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerMaintenanceGetEndsAtAttributeType(arg *ServerMaintenanceGetEndsAtAttributeType, val ServerMaintenanceGetEndsAtRetType) { + *arg = &val +} + +/* + types and functions for startsAt +*/ + +// isDateTime +type ServerMaintenanceGetStartsAtAttributeType = *time.Time +type ServerMaintenanceGetStartsAtArgType = time.Time +type ServerMaintenanceGetStartsAtRetType = time.Time + +func getServerMaintenanceGetStartsAtAttributeTypeOk(arg ServerMaintenanceGetStartsAtAttributeType) (ret ServerMaintenanceGetStartsAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerMaintenanceGetStartsAtAttributeType(arg *ServerMaintenanceGetStartsAtAttributeType, val ServerMaintenanceGetStartsAtRetType) { + *arg = &val +} + +/* + types and functions for status +*/ + +// isNotNullableString +type ServerMaintenanceGetStatusAttributeType = *string + +func getServerMaintenanceGetStatusAttributeTypeOk(arg ServerMaintenanceGetStatusAttributeType) (ret ServerMaintenanceGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerMaintenanceGetStatusAttributeType(arg *ServerMaintenanceGetStatusAttributeType, val ServerMaintenanceGetStatusRetType) { + *arg = &val +} + +type ServerMaintenanceGetStatusArgType = string +type ServerMaintenanceGetStatusRetType = string + // ServerMaintenance Object that represents the information about the next planned server maintenance window. type ServerMaintenance struct { - Details *string `json:"details,omitempty"` + Details ServerMaintenanceGetDetailsAttributeType `json:"details,omitempty"` // End of the maintenance window. // REQUIRED - EndsAt *time.Time `json:"endsAt"` + EndsAt ServerMaintenanceGetEndsAtAttributeType `json:"endsAt"` // Start of the maintenance window. // REQUIRED - StartsAt *time.Time `json:"startsAt"` + StartsAt ServerMaintenanceGetStartsAtAttributeType `json:"startsAt"` // REQUIRED - Status *string `json:"status"` + Status ServerMaintenanceGetStatusAttributeType `json:"status"` } type _ServerMaintenance ServerMaintenance @@ -37,11 +119,11 @@ type _ServerMaintenance ServerMaintenance // 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 NewServerMaintenance(endsAt *time.Time, startsAt *time.Time, status *string) *ServerMaintenance { +func NewServerMaintenance(endsAt ServerMaintenanceGetEndsAtArgType, startsAt ServerMaintenanceGetStartsAtArgType, status ServerMaintenanceGetStatusArgType) *ServerMaintenance { this := ServerMaintenance{} - this.EndsAt = endsAt - this.StartsAt = startsAt - this.Status = status + setServerMaintenanceGetEndsAtAttributeType(&this.EndsAt, endsAt) + setServerMaintenanceGetStartsAtAttributeType(&this.StartsAt, startsAt) + setServerMaintenanceGetStatusAttributeType(&this.Status, status) return &this } @@ -54,117 +136,93 @@ func NewServerMaintenanceWithDefaults() *ServerMaintenance { } // GetDetails returns the Details field value if set, zero value otherwise. -func (o *ServerMaintenance) GetDetails() *string { - if o == nil || IsNil(o.Details) { - var ret *string - return ret - } - return o.Details +func (o *ServerMaintenance) GetDetails() (res ServerMaintenanceGetDetailsRetType) { + res, _ = o.GetDetailsOk() + return } // GetDetailsOk returns a tuple with the Details field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServerMaintenance) GetDetailsOk() (*string, bool) { - if o == nil || IsNil(o.Details) { - return nil, false - } - return o.Details, true +func (o *ServerMaintenance) GetDetailsOk() (ret ServerMaintenanceGetDetailsRetType, ok bool) { + return getServerMaintenanceGetDetailsAttributeTypeOk(o.Details) } // HasDetails returns a boolean if a field has been set. func (o *ServerMaintenance) HasDetails() bool { - if o != nil && !IsNil(o.Details) { - return true - } - - return false + _, ok := o.GetDetailsOk() + return ok } // SetDetails gets a reference to the given string and assigns it to the Details field. -func (o *ServerMaintenance) SetDetails(v *string) { - o.Details = v +func (o *ServerMaintenance) SetDetails(v ServerMaintenanceGetDetailsRetType) { + setServerMaintenanceGetDetailsAttributeType(&o.Details, v) } // GetEndsAt returns the EndsAt field value -func (o *ServerMaintenance) GetEndsAt() *time.Time { - if o == nil || IsNil(o.EndsAt) { - var ret *time.Time - return ret - } - - return o.EndsAt +func (o *ServerMaintenance) GetEndsAt() (ret ServerMaintenanceGetEndsAtRetType) { + ret, _ = o.GetEndsAtOk() + return ret } // GetEndsAtOk returns a tuple with the EndsAt field value // and a boolean to check if the value has been set. -func (o *ServerMaintenance) GetEndsAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.EndsAt, true +func (o *ServerMaintenance) GetEndsAtOk() (ret ServerMaintenanceGetEndsAtRetType, ok bool) { + return getServerMaintenanceGetEndsAtAttributeTypeOk(o.EndsAt) } // SetEndsAt sets field value -func (o *ServerMaintenance) SetEndsAt(v *time.Time) { - o.EndsAt = v +func (o *ServerMaintenance) SetEndsAt(v ServerMaintenanceGetEndsAtRetType) { + setServerMaintenanceGetEndsAtAttributeType(&o.EndsAt, v) } // GetStartsAt returns the StartsAt field value -func (o *ServerMaintenance) GetStartsAt() *time.Time { - if o == nil || IsNil(o.StartsAt) { - var ret *time.Time - return ret - } - - return o.StartsAt +func (o *ServerMaintenance) GetStartsAt() (ret ServerMaintenanceGetStartsAtRetType) { + ret, _ = o.GetStartsAtOk() + return ret } // GetStartsAtOk returns a tuple with the StartsAt field value // and a boolean to check if the value has been set. -func (o *ServerMaintenance) GetStartsAtOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.StartsAt, true +func (o *ServerMaintenance) GetStartsAtOk() (ret ServerMaintenanceGetStartsAtRetType, ok bool) { + return getServerMaintenanceGetStartsAtAttributeTypeOk(o.StartsAt) } // SetStartsAt sets field value -func (o *ServerMaintenance) SetStartsAt(v *time.Time) { - o.StartsAt = v +func (o *ServerMaintenance) SetStartsAt(v ServerMaintenanceGetStartsAtRetType) { + setServerMaintenanceGetStartsAtAttributeType(&o.StartsAt, v) } // GetStatus returns the Status field value -func (o *ServerMaintenance) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - - return o.Status +func (o *ServerMaintenance) GetStatus() (ret ServerMaintenanceGetStatusRetType) { + ret, _ = o.GetStatusOk() + return ret } // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *ServerMaintenance) GetStatusOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Status, true +func (o *ServerMaintenance) GetStatusOk() (ret ServerMaintenanceGetStatusRetType, ok bool) { + return getServerMaintenanceGetStatusAttributeTypeOk(o.Status) } // SetStatus sets field value -func (o *ServerMaintenance) SetStatus(v *string) { - o.Status = v +func (o *ServerMaintenance) SetStatus(v ServerMaintenanceGetStatusRetType) { + setServerMaintenanceGetStatusAttributeType(&o.Status, v) } func (o ServerMaintenance) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Details) { - toSerialize["details"] = o.Details + if val, ok := getServerMaintenanceGetDetailsAttributeTypeOk(o.Details); ok { + toSerialize["Details"] = val + } + if val, ok := getServerMaintenanceGetEndsAtAttributeTypeOk(o.EndsAt); ok { + toSerialize["EndsAt"] = val + } + if val, ok := getServerMaintenanceGetStartsAtAttributeTypeOk(o.StartsAt); ok { + toSerialize["StartsAt"] = val + } + if val, ok := getServerMaintenanceGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } - toSerialize["endsAt"] = o.EndsAt - toSerialize["startsAt"] = o.StartsAt - toSerialize["status"] = o.Status return toSerialize, nil } diff --git a/services/iaas/model_server_network.go b/services/iaas/model_server_network.go index dffc21658..36e54c957 100644 --- a/services/iaas/model_server_network.go +++ b/services/iaas/model_server_network.go @@ -17,33 +17,240 @@ import ( // checks if the ServerNetwork type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ServerNetwork{} +/* + types and functions for allowedAddresses +*/ + +// isArray +type ServerNetworkGetAllowedAddressesAttributeType = *[]AllowedAddressesInner +type ServerNetworkGetAllowedAddressesArgType = []AllowedAddressesInner +type ServerNetworkGetAllowedAddressesRetType = []AllowedAddressesInner + +func getServerNetworkGetAllowedAddressesAttributeTypeOk(arg ServerNetworkGetAllowedAddressesAttributeType) (ret ServerNetworkGetAllowedAddressesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerNetworkGetAllowedAddressesAttributeType(arg *ServerNetworkGetAllowedAddressesAttributeType, val ServerNetworkGetAllowedAddressesRetType) { + *arg = &val +} + +/* + types and functions for ipv4 +*/ + +// isNotNullableString +type ServerNetworkGetIpv4AttributeType = *string + +func getServerNetworkGetIpv4AttributeTypeOk(arg ServerNetworkGetIpv4AttributeType) (ret ServerNetworkGetIpv4RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerNetworkGetIpv4AttributeType(arg *ServerNetworkGetIpv4AttributeType, val ServerNetworkGetIpv4RetType) { + *arg = &val +} + +type ServerNetworkGetIpv4ArgType = string +type ServerNetworkGetIpv4RetType = string + +/* + types and functions for ipv6 +*/ + +// isNotNullableString +type ServerNetworkGetIpv6AttributeType = *string + +func getServerNetworkGetIpv6AttributeTypeOk(arg ServerNetworkGetIpv6AttributeType) (ret ServerNetworkGetIpv6RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerNetworkGetIpv6AttributeType(arg *ServerNetworkGetIpv6AttributeType, val ServerNetworkGetIpv6RetType) { + *arg = &val +} + +type ServerNetworkGetIpv6ArgType = string +type ServerNetworkGetIpv6RetType = string + +/* + types and functions for mac +*/ + +// isNotNullableString +type ServerNetworkGetMacAttributeType = *string + +func getServerNetworkGetMacAttributeTypeOk(arg ServerNetworkGetMacAttributeType) (ret ServerNetworkGetMacRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerNetworkGetMacAttributeType(arg *ServerNetworkGetMacAttributeType, val ServerNetworkGetMacRetType) { + *arg = &val +} + +type ServerNetworkGetMacArgType = string +type ServerNetworkGetMacRetType = string + +/* + types and functions for networkId +*/ + +// isNotNullableString +type ServerNetworkGetNetworkIdAttributeType = *string + +func getServerNetworkGetNetworkIdAttributeTypeOk(arg ServerNetworkGetNetworkIdAttributeType) (ret ServerNetworkGetNetworkIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerNetworkGetNetworkIdAttributeType(arg *ServerNetworkGetNetworkIdAttributeType, val ServerNetworkGetNetworkIdRetType) { + *arg = &val +} + +type ServerNetworkGetNetworkIdArgType = string +type ServerNetworkGetNetworkIdRetType = string + +/* + types and functions for networkName +*/ + +// isNotNullableString +type ServerNetworkGetNetworkNameAttributeType = *string + +func getServerNetworkGetNetworkNameAttributeTypeOk(arg ServerNetworkGetNetworkNameAttributeType) (ret ServerNetworkGetNetworkNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerNetworkGetNetworkNameAttributeType(arg *ServerNetworkGetNetworkNameAttributeType, val ServerNetworkGetNetworkNameRetType) { + *arg = &val +} + +type ServerNetworkGetNetworkNameArgType = string +type ServerNetworkGetNetworkNameRetType = string + +/* + types and functions for nicId +*/ + +// isNotNullableString +type ServerNetworkGetNicIdAttributeType = *string + +func getServerNetworkGetNicIdAttributeTypeOk(arg ServerNetworkGetNicIdAttributeType) (ret ServerNetworkGetNicIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerNetworkGetNicIdAttributeType(arg *ServerNetworkGetNicIdAttributeType, val ServerNetworkGetNicIdRetType) { + *arg = &val +} + +type ServerNetworkGetNicIdArgType = string +type ServerNetworkGetNicIdRetType = string + +/* + types and functions for nicSecurity +*/ + +// isBoolean +type ServerNetworkgetNicSecurityAttributeType = *bool +type ServerNetworkgetNicSecurityArgType = bool +type ServerNetworkgetNicSecurityRetType = bool + +func getServerNetworkgetNicSecurityAttributeTypeOk(arg ServerNetworkgetNicSecurityAttributeType) (ret ServerNetworkgetNicSecurityRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerNetworkgetNicSecurityAttributeType(arg *ServerNetworkgetNicSecurityAttributeType, val ServerNetworkgetNicSecurityRetType) { + *arg = &val +} + +/* + types and functions for publicIp +*/ + +// isNotNullableString +type ServerNetworkGetPublicIpAttributeType = *string + +func getServerNetworkGetPublicIpAttributeTypeOk(arg ServerNetworkGetPublicIpAttributeType) (ret ServerNetworkGetPublicIpRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerNetworkGetPublicIpAttributeType(arg *ServerNetworkGetPublicIpAttributeType, val ServerNetworkGetPublicIpRetType) { + *arg = &val +} + +type ServerNetworkGetPublicIpArgType = string +type ServerNetworkGetPublicIpRetType = string + +/* + types and functions for securityGroups +*/ + +// isArray +type ServerNetworkGetSecurityGroupsAttributeType = *[]string +type ServerNetworkGetSecurityGroupsArgType = []string +type ServerNetworkGetSecurityGroupsRetType = []string + +func getServerNetworkGetSecurityGroupsAttributeTypeOk(arg ServerNetworkGetSecurityGroupsAttributeType) (ret ServerNetworkGetSecurityGroupsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerNetworkGetSecurityGroupsAttributeType(arg *ServerNetworkGetSecurityGroupsAttributeType, val ServerNetworkGetSecurityGroupsRetType) { + *arg = &val +} + // ServerNetwork Describes the object that matches servers to its networks. type ServerNetwork struct { // A list of IPs or CIDR notations. - AllowedAddresses *[]AllowedAddressesInner `json:"allowedAddresses,omitempty"` + AllowedAddresses ServerNetworkGetAllowedAddressesAttributeType `json:"allowedAddresses,omitempty"` // Object that represents an IP address. - Ipv4 *string `json:"ipv4,omitempty"` + Ipv4 ServerNetworkGetIpv4AttributeType `json:"ipv4,omitempty"` // Object that represents an IPv6 address. - Ipv6 *string `json:"ipv6,omitempty"` + Ipv6 ServerNetworkGetIpv6AttributeType `json:"ipv6,omitempty"` // Object that represents an MAC address. // REQUIRED - Mac *string `json:"mac"` + Mac ServerNetworkGetMacAttributeType `json:"mac"` // Universally Unique Identifier (UUID). // REQUIRED - NetworkId *string `json:"networkId"` + NetworkId ServerNetworkGetNetworkIdAttributeType `json:"networkId"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED - NetworkName *string `json:"networkName"` + NetworkName ServerNetworkGetNetworkNameAttributeType `json:"networkName"` // Universally Unique Identifier (UUID). // REQUIRED - NicId *string `json:"nicId"` + NicId ServerNetworkGetNicIdAttributeType `json:"nicId"` // If this is set to false, then no security groups will apply to this server network interface. // REQUIRED - NicSecurity *bool `json:"nicSecurity"` + NicSecurity ServerNetworkgetNicSecurityAttributeType `json:"nicSecurity"` // Object that represents an IP address. - PublicIp *string `json:"publicIp,omitempty"` + PublicIp ServerNetworkGetPublicIpAttributeType `json:"publicIp,omitempty"` // A list of UUIDs. - SecurityGroups *[]string `json:"securityGroups,omitempty"` + SecurityGroups ServerNetworkGetSecurityGroupsAttributeType `json:"securityGroups,omitempty"` } type _ServerNetwork ServerNetwork @@ -52,13 +259,13 @@ type _ServerNetwork ServerNetwork // 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 NewServerNetwork(mac *string, networkId *string, networkName *string, nicId *string, nicSecurity *bool) *ServerNetwork { +func NewServerNetwork(mac ServerNetworkGetMacArgType, networkId ServerNetworkGetNetworkIdArgType, networkName ServerNetworkGetNetworkNameArgType, nicId ServerNetworkGetNicIdArgType, nicSecurity ServerNetworkgetNicSecurityArgType) *ServerNetwork { this := ServerNetwork{} - this.Mac = mac - this.NetworkId = networkId - this.NetworkName = networkName - this.NicId = nicId - this.NicSecurity = nicSecurity + setServerNetworkGetMacAttributeType(&this.Mac, mac) + setServerNetworkGetNetworkIdAttributeType(&this.NetworkId, networkId) + setServerNetworkGetNetworkNameAttributeType(&this.NetworkName, networkName) + setServerNetworkGetNicIdAttributeType(&this.NicId, nicId) + setServerNetworkgetNicSecurityAttributeType(&this.NicSecurity, nicSecurity) return &this } @@ -71,306 +278,236 @@ func NewServerNetworkWithDefaults() *ServerNetwork { } // GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. -func (o *ServerNetwork) GetAllowedAddresses() *[]AllowedAddressesInner { - if o == nil || IsNil(o.AllowedAddresses) { - var ret *[]AllowedAddressesInner - return ret - } - return o.AllowedAddresses +func (o *ServerNetwork) GetAllowedAddresses() (res ServerNetworkGetAllowedAddressesRetType) { + res, _ = o.GetAllowedAddressesOk() + return } // GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServerNetwork) GetAllowedAddressesOk() (*[]AllowedAddressesInner, bool) { - if o == nil || IsNil(o.AllowedAddresses) { - return nil, false - } - return o.AllowedAddresses, true +func (o *ServerNetwork) GetAllowedAddressesOk() (ret ServerNetworkGetAllowedAddressesRetType, ok bool) { + return getServerNetworkGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses) } // HasAllowedAddresses returns a boolean if a field has been set. func (o *ServerNetwork) HasAllowedAddresses() bool { - if o != nil && !IsNil(o.AllowedAddresses) { - return true - } - - return false + _, ok := o.GetAllowedAddressesOk() + return ok } // SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. -func (o *ServerNetwork) SetAllowedAddresses(v *[]AllowedAddressesInner) { - o.AllowedAddresses = v +func (o *ServerNetwork) SetAllowedAddresses(v ServerNetworkGetAllowedAddressesRetType) { + setServerNetworkGetAllowedAddressesAttributeType(&o.AllowedAddresses, v) } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *ServerNetwork) GetIpv4() *string { - if o == nil || IsNil(o.Ipv4) { - var ret *string - return ret - } - return o.Ipv4 +func (o *ServerNetwork) GetIpv4() (res ServerNetworkGetIpv4RetType) { + res, _ = o.GetIpv4Ok() + return } // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServerNetwork) GetIpv4Ok() (*string, bool) { - if o == nil || IsNil(o.Ipv4) { - return nil, false - } - return o.Ipv4, true +func (o *ServerNetwork) GetIpv4Ok() (ret ServerNetworkGetIpv4RetType, ok bool) { + return getServerNetworkGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. func (o *ServerNetwork) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { - return true - } - - return false + _, ok := o.GetIpv4Ok() + return ok } // SetIpv4 gets a reference to the given string and assigns it to the Ipv4 field. -func (o *ServerNetwork) SetIpv4(v *string) { - o.Ipv4 = v +func (o *ServerNetwork) SetIpv4(v ServerNetworkGetIpv4RetType) { + setServerNetworkGetIpv4AttributeType(&o.Ipv4, v) } // GetIpv6 returns the Ipv6 field value if set, zero value otherwise. -func (o *ServerNetwork) GetIpv6() *string { - if o == nil || IsNil(o.Ipv6) { - var ret *string - return ret - } - return o.Ipv6 +func (o *ServerNetwork) GetIpv6() (res ServerNetworkGetIpv6RetType) { + res, _ = o.GetIpv6Ok() + return } // GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServerNetwork) GetIpv6Ok() (*string, bool) { - if o == nil || IsNil(o.Ipv6) { - return nil, false - } - return o.Ipv6, true +func (o *ServerNetwork) GetIpv6Ok() (ret ServerNetworkGetIpv6RetType, ok bool) { + return getServerNetworkGetIpv6AttributeTypeOk(o.Ipv6) } // HasIpv6 returns a boolean if a field has been set. func (o *ServerNetwork) HasIpv6() bool { - if o != nil && !IsNil(o.Ipv6) { - return true - } - - return false + _, ok := o.GetIpv6Ok() + return ok } // SetIpv6 gets a reference to the given string and assigns it to the Ipv6 field. -func (o *ServerNetwork) SetIpv6(v *string) { - o.Ipv6 = v +func (o *ServerNetwork) SetIpv6(v ServerNetworkGetIpv6RetType) { + setServerNetworkGetIpv6AttributeType(&o.Ipv6, v) } // GetMac returns the Mac field value -func (o *ServerNetwork) GetMac() *string { - if o == nil || IsNil(o.Mac) { - var ret *string - return ret - } - - return o.Mac +func (o *ServerNetwork) GetMac() (ret ServerNetworkGetMacRetType) { + ret, _ = o.GetMacOk() + return ret } // GetMacOk returns a tuple with the Mac field value // and a boolean to check if the value has been set. -func (o *ServerNetwork) GetMacOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Mac, true +func (o *ServerNetwork) GetMacOk() (ret ServerNetworkGetMacRetType, ok bool) { + return getServerNetworkGetMacAttributeTypeOk(o.Mac) } // SetMac sets field value -func (o *ServerNetwork) SetMac(v *string) { - o.Mac = v +func (o *ServerNetwork) SetMac(v ServerNetworkGetMacRetType) { + setServerNetworkGetMacAttributeType(&o.Mac, v) } // GetNetworkId returns the NetworkId field value -func (o *ServerNetwork) GetNetworkId() *string { - if o == nil || IsNil(o.NetworkId) { - var ret *string - return ret - } - - return o.NetworkId +func (o *ServerNetwork) GetNetworkId() (ret ServerNetworkGetNetworkIdRetType) { + ret, _ = o.GetNetworkIdOk() + return ret } // GetNetworkIdOk returns a tuple with the NetworkId field value // and a boolean to check if the value has been set. -func (o *ServerNetwork) GetNetworkIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.NetworkId, true +func (o *ServerNetwork) GetNetworkIdOk() (ret ServerNetworkGetNetworkIdRetType, ok bool) { + return getServerNetworkGetNetworkIdAttributeTypeOk(o.NetworkId) } // SetNetworkId sets field value -func (o *ServerNetwork) SetNetworkId(v *string) { - o.NetworkId = v +func (o *ServerNetwork) SetNetworkId(v ServerNetworkGetNetworkIdRetType) { + setServerNetworkGetNetworkIdAttributeType(&o.NetworkId, v) } // GetNetworkName returns the NetworkName field value -func (o *ServerNetwork) GetNetworkName() *string { - if o == nil || IsNil(o.NetworkName) { - var ret *string - return ret - } - - return o.NetworkName +func (o *ServerNetwork) GetNetworkName() (ret ServerNetworkGetNetworkNameRetType) { + ret, _ = o.GetNetworkNameOk() + return ret } // GetNetworkNameOk returns a tuple with the NetworkName field value // and a boolean to check if the value has been set. -func (o *ServerNetwork) GetNetworkNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.NetworkName, true +func (o *ServerNetwork) GetNetworkNameOk() (ret ServerNetworkGetNetworkNameRetType, ok bool) { + return getServerNetworkGetNetworkNameAttributeTypeOk(o.NetworkName) } // SetNetworkName sets field value -func (o *ServerNetwork) SetNetworkName(v *string) { - o.NetworkName = v +func (o *ServerNetwork) SetNetworkName(v ServerNetworkGetNetworkNameRetType) { + setServerNetworkGetNetworkNameAttributeType(&o.NetworkName, v) } // GetNicId returns the NicId field value -func (o *ServerNetwork) GetNicId() *string { - if o == nil || IsNil(o.NicId) { - var ret *string - return ret - } - - return o.NicId +func (o *ServerNetwork) GetNicId() (ret ServerNetworkGetNicIdRetType) { + ret, _ = o.GetNicIdOk() + return ret } // GetNicIdOk returns a tuple with the NicId field value // and a boolean to check if the value has been set. -func (o *ServerNetwork) GetNicIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.NicId, true +func (o *ServerNetwork) GetNicIdOk() (ret ServerNetworkGetNicIdRetType, ok bool) { + return getServerNetworkGetNicIdAttributeTypeOk(o.NicId) } // SetNicId sets field value -func (o *ServerNetwork) SetNicId(v *string) { - o.NicId = v +func (o *ServerNetwork) SetNicId(v ServerNetworkGetNicIdRetType) { + setServerNetworkGetNicIdAttributeType(&o.NicId, v) } // GetNicSecurity returns the NicSecurity field value -func (o *ServerNetwork) GetNicSecurity() *bool { - if o == nil || IsNil(o.NicSecurity) { - var ret *bool - return ret - } - - return o.NicSecurity +func (o *ServerNetwork) GetNicSecurity() (ret ServerNetworkgetNicSecurityRetType) { + ret, _ = o.GetNicSecurityOk() + return ret } // GetNicSecurityOk returns a tuple with the NicSecurity field value // and a boolean to check if the value has been set. -func (o *ServerNetwork) GetNicSecurityOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.NicSecurity, true +func (o *ServerNetwork) GetNicSecurityOk() (ret ServerNetworkgetNicSecurityRetType, ok bool) { + return getServerNetworkgetNicSecurityAttributeTypeOk(o.NicSecurity) } // SetNicSecurity sets field value -func (o *ServerNetwork) SetNicSecurity(v *bool) { - o.NicSecurity = v +func (o *ServerNetwork) SetNicSecurity(v ServerNetworkgetNicSecurityRetType) { + setServerNetworkgetNicSecurityAttributeType(&o.NicSecurity, v) } // GetPublicIp returns the PublicIp field value if set, zero value otherwise. -func (o *ServerNetwork) GetPublicIp() *string { - if o == nil || IsNil(o.PublicIp) { - var ret *string - return ret - } - return o.PublicIp +func (o *ServerNetwork) GetPublicIp() (res ServerNetworkGetPublicIpRetType) { + res, _ = o.GetPublicIpOk() + return } // GetPublicIpOk returns a tuple with the PublicIp field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServerNetwork) GetPublicIpOk() (*string, bool) { - if o == nil || IsNil(o.PublicIp) { - return nil, false - } - return o.PublicIp, true +func (o *ServerNetwork) GetPublicIpOk() (ret ServerNetworkGetPublicIpRetType, ok bool) { + return getServerNetworkGetPublicIpAttributeTypeOk(o.PublicIp) } // HasPublicIp returns a boolean if a field has been set. func (o *ServerNetwork) HasPublicIp() bool { - if o != nil && !IsNil(o.PublicIp) { - return true - } - - return false + _, ok := o.GetPublicIpOk() + return ok } // SetPublicIp gets a reference to the given string and assigns it to the PublicIp field. -func (o *ServerNetwork) SetPublicIp(v *string) { - o.PublicIp = v +func (o *ServerNetwork) SetPublicIp(v ServerNetworkGetPublicIpRetType) { + setServerNetworkGetPublicIpAttributeType(&o.PublicIp, v) } // GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. -func (o *ServerNetwork) GetSecurityGroups() *[]string { - if o == nil || IsNil(o.SecurityGroups) { - var ret *[]string - return ret - } - return o.SecurityGroups +func (o *ServerNetwork) GetSecurityGroups() (res ServerNetworkGetSecurityGroupsRetType) { + res, _ = o.GetSecurityGroupsOk() + return } // GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServerNetwork) GetSecurityGroupsOk() (*[]string, bool) { - if o == nil || IsNil(o.SecurityGroups) { - return nil, false - } - return o.SecurityGroups, true +func (o *ServerNetwork) GetSecurityGroupsOk() (ret ServerNetworkGetSecurityGroupsRetType, ok bool) { + return getServerNetworkGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) } // HasSecurityGroups returns a boolean if a field has been set. func (o *ServerNetwork) HasSecurityGroups() bool { - if o != nil && !IsNil(o.SecurityGroups) { - return true - } - - return false + _, ok := o.GetSecurityGroupsOk() + return ok } // SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. -func (o *ServerNetwork) SetSecurityGroups(v *[]string) { - o.SecurityGroups = v +func (o *ServerNetwork) SetSecurityGroups(v ServerNetworkGetSecurityGroupsRetType) { + setServerNetworkGetSecurityGroupsAttributeType(&o.SecurityGroups, v) } func (o ServerNetwork) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.AllowedAddresses) { - toSerialize["allowedAddresses"] = o.AllowedAddresses + if val, ok := getServerNetworkGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses); ok { + toSerialize["AllowedAddresses"] = val + } + if val, ok := getServerNetworkGetIpv4AttributeTypeOk(o.Ipv4); ok { + toSerialize["Ipv4"] = val + } + if val, ok := getServerNetworkGetIpv6AttributeTypeOk(o.Ipv6); ok { + toSerialize["Ipv6"] = val + } + if val, ok := getServerNetworkGetMacAttributeTypeOk(o.Mac); ok { + toSerialize["Mac"] = val + } + if val, ok := getServerNetworkGetNetworkIdAttributeTypeOk(o.NetworkId); ok { + toSerialize["NetworkId"] = val + } + if val, ok := getServerNetworkGetNetworkNameAttributeTypeOk(o.NetworkName); ok { + toSerialize["NetworkName"] = val } - if !IsNil(o.Ipv4) { - toSerialize["ipv4"] = o.Ipv4 + if val, ok := getServerNetworkGetNicIdAttributeTypeOk(o.NicId); ok { + toSerialize["NicId"] = val } - if !IsNil(o.Ipv6) { - toSerialize["ipv6"] = o.Ipv6 + if val, ok := getServerNetworkgetNicSecurityAttributeTypeOk(o.NicSecurity); ok { + toSerialize["NicSecurity"] = val } - toSerialize["mac"] = o.Mac - toSerialize["networkId"] = o.NetworkId - toSerialize["networkName"] = o.NetworkName - toSerialize["nicId"] = o.NicId - toSerialize["nicSecurity"] = o.NicSecurity - if !IsNil(o.PublicIp) { - toSerialize["publicIp"] = o.PublicIp + if val, ok := getServerNetworkGetPublicIpAttributeTypeOk(o.PublicIp); ok { + toSerialize["PublicIp"] = val } - if !IsNil(o.SecurityGroups) { - toSerialize["securityGroups"] = o.SecurityGroups + if val, ok := getServerNetworkGetSecurityGroupsAttributeTypeOk(o.SecurityGroups); ok { + toSerialize["SecurityGroups"] = val } return toSerialize, nil } diff --git a/services/iaas/model_service_account_mail_list_response.go b/services/iaas/model_service_account_mail_list_response.go index 689fd6470..1a7bc1ed7 100644 --- a/services/iaas/model_service_account_mail_list_response.go +++ b/services/iaas/model_service_account_mail_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the ServiceAccountMailListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ServiceAccountMailListResponse{} +/* + types and functions for items +*/ + +// isArray +type ServiceAccountMailListResponseGetItemsAttributeType = *[]string +type ServiceAccountMailListResponseGetItemsArgType = []string +type ServiceAccountMailListResponseGetItemsRetType = []string + +func getServiceAccountMailListResponseGetItemsAttributeTypeOk(arg ServiceAccountMailListResponseGetItemsAttributeType) (ret ServiceAccountMailListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceAccountMailListResponseGetItemsAttributeType(arg *ServiceAccountMailListResponseGetItemsAttributeType, val ServiceAccountMailListResponseGetItemsRetType) { + *arg = &val +} + // ServiceAccountMailListResponse Service account mail list response. type ServiceAccountMailListResponse struct { // A list of service account mails. // REQUIRED - Items *[]string `json:"items"` + Items ServiceAccountMailListResponseGetItemsAttributeType `json:"items"` } type _ServiceAccountMailListResponse ServiceAccountMailListResponse @@ -30,9 +50,9 @@ type _ServiceAccountMailListResponse ServiceAccountMailListResponse // 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 NewServiceAccountMailListResponse(items *[]string) *ServiceAccountMailListResponse { +func NewServiceAccountMailListResponse(items ServiceAccountMailListResponseGetItemsArgType) *ServiceAccountMailListResponse { this := ServiceAccountMailListResponse{} - this.Items = items + setServiceAccountMailListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewServiceAccountMailListResponseWithDefaults() *ServiceAccountMailListResp } // GetItems returns the Items field value -func (o *ServiceAccountMailListResponse) GetItems() *[]string { - if o == nil || IsNil(o.Items) { - var ret *[]string - return ret - } - - return o.Items +func (o *ServiceAccountMailListResponse) GetItems() (ret ServiceAccountMailListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *ServiceAccountMailListResponse) GetItemsOk() (*[]string, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *ServiceAccountMailListResponse) GetItemsOk() (ret ServiceAccountMailListResponseGetItemsRetType, ok bool) { + return getServiceAccountMailListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *ServiceAccountMailListResponse) SetItems(v *[]string) { - o.Items = v +func (o *ServiceAccountMailListResponse) SetItems(v ServiceAccountMailListResponseGetItemsRetType) { + setServiceAccountMailListResponseGetItemsAttributeType(&o.Items, v) } func (o ServiceAccountMailListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getServiceAccountMailListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_set_image_share_payload.go b/services/iaas/model_set_image_share_payload.go index bc72e77b0..158f51949 100644 --- a/services/iaas/model_set_image_share_payload.go +++ b/services/iaas/model_set_image_share_payload.go @@ -17,12 +17,52 @@ import ( // checks if the SetImageSharePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &SetImageSharePayload{} +/* + types and functions for parentOrganization +*/ + +// isBoolean +type SetImageSharePayloadgetParentOrganizationAttributeType = *bool +type SetImageSharePayloadgetParentOrganizationArgType = bool +type SetImageSharePayloadgetParentOrganizationRetType = bool + +func getSetImageSharePayloadgetParentOrganizationAttributeTypeOk(arg SetImageSharePayloadgetParentOrganizationAttributeType) (ret SetImageSharePayloadgetParentOrganizationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSetImageSharePayloadgetParentOrganizationAttributeType(arg *SetImageSharePayloadgetParentOrganizationAttributeType, val SetImageSharePayloadgetParentOrganizationRetType) { + *arg = &val +} + +/* + types and functions for projects +*/ + +// isArray +type SetImageSharePayloadGetProjectsAttributeType = *[]string +type SetImageSharePayloadGetProjectsArgType = []string +type SetImageSharePayloadGetProjectsRetType = []string + +func getSetImageSharePayloadGetProjectsAttributeTypeOk(arg SetImageSharePayloadGetProjectsAttributeType) (ret SetImageSharePayloadGetProjectsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSetImageSharePayloadGetProjectsAttributeType(arg *SetImageSharePayloadGetProjectsAttributeType, val SetImageSharePayloadGetProjectsRetType) { + *arg = &val +} + // SetImageSharePayload Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. type SetImageSharePayload struct { // Image is shared with all projects inside the image owners organization. - ParentOrganization *bool `json:"parentOrganization,omitempty"` + ParentOrganization SetImageSharePayloadgetParentOrganizationAttributeType `json:"parentOrganization,omitempty"` // List of all projects the Image is shared with. - Projects *[]string `json:"projects,omitempty"` + Projects SetImageSharePayloadGetProjectsAttributeType `json:"projects,omitempty"` } // NewSetImageSharePayload instantiates a new SetImageSharePayload object @@ -43,76 +83,58 @@ func NewSetImageSharePayloadWithDefaults() *SetImageSharePayload { } // GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. -func (o *SetImageSharePayload) GetParentOrganization() *bool { - if o == nil || IsNil(o.ParentOrganization) { - var ret *bool - return ret - } - return o.ParentOrganization +func (o *SetImageSharePayload) GetParentOrganization() (res SetImageSharePayloadgetParentOrganizationRetType) { + res, _ = o.GetParentOrganizationOk() + return } // GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SetImageSharePayload) GetParentOrganizationOk() (*bool, bool) { - if o == nil || IsNil(o.ParentOrganization) { - return nil, false - } - return o.ParentOrganization, true +func (o *SetImageSharePayload) GetParentOrganizationOk() (ret SetImageSharePayloadgetParentOrganizationRetType, ok bool) { + return getSetImageSharePayloadgetParentOrganizationAttributeTypeOk(o.ParentOrganization) } // HasParentOrganization returns a boolean if a field has been set. func (o *SetImageSharePayload) HasParentOrganization() bool { - if o != nil && !IsNil(o.ParentOrganization) { - return true - } - - return false + _, ok := o.GetParentOrganizationOk() + return ok } // SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. -func (o *SetImageSharePayload) SetParentOrganization(v *bool) { - o.ParentOrganization = v +func (o *SetImageSharePayload) SetParentOrganization(v SetImageSharePayloadgetParentOrganizationRetType) { + setSetImageSharePayloadgetParentOrganizationAttributeType(&o.ParentOrganization, v) } // GetProjects returns the Projects field value if set, zero value otherwise. -func (o *SetImageSharePayload) GetProjects() *[]string { - if o == nil || IsNil(o.Projects) { - var ret *[]string - return ret - } - return o.Projects +func (o *SetImageSharePayload) GetProjects() (res SetImageSharePayloadGetProjectsRetType) { + res, _ = o.GetProjectsOk() + return } // GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SetImageSharePayload) GetProjectsOk() (*[]string, bool) { - if o == nil || IsNil(o.Projects) { - return nil, false - } - return o.Projects, true +func (o *SetImageSharePayload) GetProjectsOk() (ret SetImageSharePayloadGetProjectsRetType, ok bool) { + return getSetImageSharePayloadGetProjectsAttributeTypeOk(o.Projects) } // HasProjects returns a boolean if a field has been set. func (o *SetImageSharePayload) HasProjects() bool { - if o != nil && !IsNil(o.Projects) { - return true - } - - return false + _, ok := o.GetProjectsOk() + return ok } // SetProjects gets a reference to the given []string and assigns it to the Projects field. -func (o *SetImageSharePayload) SetProjects(v *[]string) { - o.Projects = v +func (o *SetImageSharePayload) SetProjects(v SetImageSharePayloadGetProjectsRetType) { + setSetImageSharePayloadGetProjectsAttributeType(&o.Projects, v) } func (o SetImageSharePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.ParentOrganization) { - toSerialize["parentOrganization"] = o.ParentOrganization + if val, ok := getSetImageSharePayloadgetParentOrganizationAttributeTypeOk(o.ParentOrganization); ok { + toSerialize["ParentOrganization"] = val } - if !IsNil(o.Projects) { - toSerialize["projects"] = o.Projects + if val, ok := getSetImageSharePayloadGetProjectsAttributeTypeOk(o.Projects); ok { + toSerialize["Projects"] = val } return toSerialize, nil } diff --git a/services/iaas/model_snapshot.go b/services/iaas/model_snapshot.go index 9935d7e09..086cff6ee 100644 --- a/services/iaas/model_snapshot.go +++ b/services/iaas/model_snapshot.go @@ -18,25 +18,189 @@ import ( // checks if the Snapshot type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Snapshot{} +/* + types and functions for createdAt +*/ + +// isDateTime +type SnapshotGetCreatedAtAttributeType = *time.Time +type SnapshotGetCreatedAtArgType = time.Time +type SnapshotGetCreatedAtRetType = time.Time + +func getSnapshotGetCreatedAtAttributeTypeOk(arg SnapshotGetCreatedAtAttributeType) (ret SnapshotGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSnapshotGetCreatedAtAttributeType(arg *SnapshotGetCreatedAtAttributeType, val SnapshotGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type SnapshotGetIdAttributeType = *string + +func getSnapshotGetIdAttributeTypeOk(arg SnapshotGetIdAttributeType) (ret SnapshotGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSnapshotGetIdAttributeType(arg *SnapshotGetIdAttributeType, val SnapshotGetIdRetType) { + *arg = &val +} + +type SnapshotGetIdArgType = string +type SnapshotGetIdRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type SnapshotGetLabelsAttributeType = *map[string]interface{} +type SnapshotGetLabelsArgType = map[string]interface{} +type SnapshotGetLabelsRetType = map[string]interface{} + +func getSnapshotGetLabelsAttributeTypeOk(arg SnapshotGetLabelsAttributeType) (ret SnapshotGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSnapshotGetLabelsAttributeType(arg *SnapshotGetLabelsAttributeType, val SnapshotGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type SnapshotGetNameAttributeType = *string + +func getSnapshotGetNameAttributeTypeOk(arg SnapshotGetNameAttributeType) (ret SnapshotGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSnapshotGetNameAttributeType(arg *SnapshotGetNameAttributeType, val SnapshotGetNameRetType) { + *arg = &val +} + +type SnapshotGetNameArgType = string +type SnapshotGetNameRetType = string + +/* + types and functions for size +*/ + +// isLong +type SnapshotGetSizeAttributeType = *int64 +type SnapshotGetSizeArgType = int64 +type SnapshotGetSizeRetType = int64 + +func getSnapshotGetSizeAttributeTypeOk(arg SnapshotGetSizeAttributeType) (ret SnapshotGetSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSnapshotGetSizeAttributeType(arg *SnapshotGetSizeAttributeType, val SnapshotGetSizeRetType) { + *arg = &val +} + +/* + types and functions for status +*/ + +// isNotNullableString +type SnapshotGetStatusAttributeType = *string + +func getSnapshotGetStatusAttributeTypeOk(arg SnapshotGetStatusAttributeType) (ret SnapshotGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSnapshotGetStatusAttributeType(arg *SnapshotGetStatusAttributeType, val SnapshotGetStatusRetType) { + *arg = &val +} + +type SnapshotGetStatusArgType = string +type SnapshotGetStatusRetType = string + +/* + types and functions for updatedAt +*/ + +// isDateTime +type SnapshotGetUpdatedAtAttributeType = *time.Time +type SnapshotGetUpdatedAtArgType = time.Time +type SnapshotGetUpdatedAtRetType = time.Time + +func getSnapshotGetUpdatedAtAttributeTypeOk(arg SnapshotGetUpdatedAtAttributeType) (ret SnapshotGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSnapshotGetUpdatedAtAttributeType(arg *SnapshotGetUpdatedAtAttributeType, val SnapshotGetUpdatedAtRetType) { + *arg = &val +} + +/* + types and functions for volumeId +*/ + +// isNotNullableString +type SnapshotGetVolumeIdAttributeType = *string + +func getSnapshotGetVolumeIdAttributeTypeOk(arg SnapshotGetVolumeIdAttributeType) (ret SnapshotGetVolumeIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSnapshotGetVolumeIdAttributeType(arg *SnapshotGetVolumeIdAttributeType, val SnapshotGetVolumeIdRetType) { + *arg = &val +} + +type SnapshotGetVolumeIdArgType = string +type SnapshotGetVolumeIdRetType = string + // Snapshot Object that represents a snapshot. type Snapshot struct { // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt SnapshotGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id SnapshotGetIdAttributeType `json:"id,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels SnapshotGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty"` + Name SnapshotGetNameAttributeType `json:"name,omitempty"` // Size in Gigabyte. - Size *int64 `json:"size,omitempty"` + Size SnapshotGetSizeAttributeType `json:"size,omitempty"` // The status of a snapshot object. Possible values: `AVAILABLE`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`, `UNMANAGING`, `UPDATING`. - Status *string `json:"status,omitempty"` + Status SnapshotGetStatusAttributeType `json:"status,omitempty"` // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAt SnapshotGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` // Universally Unique Identifier (UUID). // REQUIRED - VolumeId *string `json:"volumeId"` + VolumeId SnapshotGetVolumeIdAttributeType `json:"volumeId"` } type _Snapshot Snapshot @@ -45,9 +209,9 @@ type _Snapshot Snapshot // 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 NewSnapshot(volumeId *string) *Snapshot { +func NewSnapshot(volumeId SnapshotGetVolumeIdArgType) *Snapshot { this := Snapshot{} - this.VolumeId = volumeId + setSnapshotGetVolumeIdAttributeType(&this.VolumeId, volumeId) return &this } @@ -60,277 +224,209 @@ func NewSnapshotWithDefaults() *Snapshot { } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *Snapshot) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - return o.CreatedAt +func (o *Snapshot) GetCreatedAt() (res SnapshotGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return } // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Snapshot) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true +func (o *Snapshot) GetCreatedAtOk() (ret SnapshotGetCreatedAtRetType, ok bool) { + return getSnapshotGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. func (o *Snapshot) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false + _, ok := o.GetCreatedAtOk() + return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *Snapshot) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *Snapshot) SetCreatedAt(v SnapshotGetCreatedAtRetType) { + setSnapshotGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *Snapshot) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *Snapshot) GetId() (res SnapshotGetIdRetType) { + 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 *Snapshot) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *Snapshot) GetIdOk() (ret SnapshotGetIdRetType, ok bool) { + return getSnapshotGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *Snapshot) 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 *Snapshot) SetId(v *string) { - o.Id = v +func (o *Snapshot) SetId(v SnapshotGetIdRetType) { + setSnapshotGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *Snapshot) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *Snapshot) GetLabels() (res SnapshotGetLabelsRetType) { + 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 *Snapshot) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *Snapshot) GetLabelsOk() (ret SnapshotGetLabelsRetType, ok bool) { + return getSnapshotGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *Snapshot) 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 *Snapshot) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *Snapshot) SetLabels(v SnapshotGetLabelsRetType) { + setSnapshotGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *Snapshot) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *Snapshot) GetName() (res SnapshotGetNameRetType) { + 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 *Snapshot) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *Snapshot) GetNameOk() (ret SnapshotGetNameRetType, ok bool) { + return getSnapshotGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *Snapshot) 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 *Snapshot) SetName(v *string) { - o.Name = v +func (o *Snapshot) SetName(v SnapshotGetNameRetType) { + setSnapshotGetNameAttributeType(&o.Name, v) } // GetSize returns the Size field value if set, zero value otherwise. -func (o *Snapshot) GetSize() *int64 { - if o == nil || IsNil(o.Size) { - var ret *int64 - return ret - } - return o.Size +func (o *Snapshot) GetSize() (res SnapshotGetSizeRetType) { + 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 *Snapshot) GetSizeOk() (*int64, bool) { - if o == nil || IsNil(o.Size) { - return nil, false - } - return o.Size, true +func (o *Snapshot) GetSizeOk() (ret SnapshotGetSizeRetType, ok bool) { + return getSnapshotGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. func (o *Snapshot) 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 *Snapshot) SetSize(v *int64) { - o.Size = v +func (o *Snapshot) SetSize(v SnapshotGetSizeRetType) { + setSnapshotGetSizeAttributeType(&o.Size, v) } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *Snapshot) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - return o.Status +func (o *Snapshot) GetStatus() (res SnapshotGetStatusRetType) { + 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 *Snapshot) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true +func (o *Snapshot) GetStatusOk() (ret SnapshotGetStatusRetType, ok bool) { + return getSnapshotGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. func (o *Snapshot) 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 *Snapshot) SetStatus(v *string) { - o.Status = v +func (o *Snapshot) SetStatus(v SnapshotGetStatusRetType) { + setSnapshotGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *Snapshot) GetUpdatedAt() *time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret *time.Time - return ret - } - return o.UpdatedAt +func (o *Snapshot) GetUpdatedAt() (res SnapshotGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Snapshot) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true +func (o *Snapshot) GetUpdatedAtOk() (ret SnapshotGetUpdatedAtRetType, ok bool) { + return getSnapshotGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. func (o *Snapshot) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false + _, ok := o.GetUpdatedAtOk() + return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *Snapshot) SetUpdatedAt(v *time.Time) { - o.UpdatedAt = v +func (o *Snapshot) SetUpdatedAt(v SnapshotGetUpdatedAtRetType) { + setSnapshotGetUpdatedAtAttributeType(&o.UpdatedAt, v) } // GetVolumeId returns the VolumeId field value -func (o *Snapshot) GetVolumeId() *string { - if o == nil || IsNil(o.VolumeId) { - var ret *string - return ret - } - - return o.VolumeId +func (o *Snapshot) GetVolumeId() (ret SnapshotGetVolumeIdRetType) { + ret, _ = o.GetVolumeIdOk() + return ret } // GetVolumeIdOk returns a tuple with the VolumeId field value // and a boolean to check if the value has been set. -func (o *Snapshot) GetVolumeIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.VolumeId, true +func (o *Snapshot) GetVolumeIdOk() (ret SnapshotGetVolumeIdRetType, ok bool) { + return getSnapshotGetVolumeIdAttributeTypeOk(o.VolumeId) } // SetVolumeId sets field value -func (o *Snapshot) SetVolumeId(v *string) { - o.VolumeId = v +func (o *Snapshot) SetVolumeId(v SnapshotGetVolumeIdRetType) { + setSnapshotGetVolumeIdAttributeType(&o.VolumeId, v) } func (o Snapshot) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt + if val, ok := getSnapshotGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getSnapshotGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getSnapshotGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getSnapshotGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getSnapshotGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val } - if !IsNil(o.Size) { - toSerialize["size"] = o.Size + if val, ok := getSnapshotGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status + if val, ok := getSnapshotGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt + if val, ok := getSnapshotGetVolumeIdAttributeTypeOk(o.VolumeId); ok { + toSerialize["VolumeId"] = val } - toSerialize["volumeId"] = o.VolumeId return toSerialize, nil } diff --git a/services/iaas/model_snapshot_list_response.go b/services/iaas/model_snapshot_list_response.go index 2d6b3d445..05281a542 100644 --- a/services/iaas/model_snapshot_list_response.go +++ b/services/iaas/model_snapshot_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the SnapshotListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &SnapshotListResponse{} +/* + types and functions for items +*/ + +// isArray +type SnapshotListResponseGetItemsAttributeType = *[]Snapshot +type SnapshotListResponseGetItemsArgType = []Snapshot +type SnapshotListResponseGetItemsRetType = []Snapshot + +func getSnapshotListResponseGetItemsAttributeTypeOk(arg SnapshotListResponseGetItemsAttributeType) (ret SnapshotListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setSnapshotListResponseGetItemsAttributeType(arg *SnapshotListResponseGetItemsAttributeType, val SnapshotListResponseGetItemsRetType) { + *arg = &val +} + // SnapshotListResponse Snapshot list response. type SnapshotListResponse struct { // A list containing snapshot objects. // REQUIRED - Items *[]Snapshot `json:"items"` + Items SnapshotListResponseGetItemsAttributeType `json:"items"` } type _SnapshotListResponse SnapshotListResponse @@ -30,9 +50,9 @@ type _SnapshotListResponse SnapshotListResponse // 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 NewSnapshotListResponse(items *[]Snapshot) *SnapshotListResponse { +func NewSnapshotListResponse(items SnapshotListResponseGetItemsArgType) *SnapshotListResponse { this := SnapshotListResponse{} - this.Items = items + setSnapshotListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewSnapshotListResponseWithDefaults() *SnapshotListResponse { } // GetItems returns the Items field value -func (o *SnapshotListResponse) GetItems() *[]Snapshot { - if o == nil || IsNil(o.Items) { - var ret *[]Snapshot - return ret - } - - return o.Items +func (o *SnapshotListResponse) GetItems() (ret SnapshotListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *SnapshotListResponse) GetItemsOk() (*[]Snapshot, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *SnapshotListResponse) GetItemsOk() (ret SnapshotListResponseGetItemsRetType, ok bool) { + return getSnapshotListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *SnapshotListResponse) SetItems(v *[]Snapshot) { - o.Items = v +func (o *SnapshotListResponse) SetItems(v SnapshotListResponseGetItemsRetType) { + setSnapshotListResponseGetItemsAttributeType(&o.Items, v) } func (o SnapshotListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getSnapshotListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_update_area_address_family.go b/services/iaas/model_update_area_address_family.go index ca1cf7314..30c26928d 100644 --- a/services/iaas/model_update_area_address_family.go +++ b/services/iaas/model_update_area_address_family.go @@ -17,9 +17,29 @@ import ( // checks if the UpdateAreaAddressFamily type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateAreaAddressFamily{} +/* + types and functions for ipv4 +*/ + +// isModel +type UpdateAreaAddressFamilyGetIpv4AttributeType = *UpdateAreaIPv4 +type UpdateAreaAddressFamilyGetIpv4ArgType = UpdateAreaIPv4 +type UpdateAreaAddressFamilyGetIpv4RetType = UpdateAreaIPv4 + +func getUpdateAreaAddressFamilyGetIpv4AttributeTypeOk(arg UpdateAreaAddressFamilyGetIpv4AttributeType) (ret UpdateAreaAddressFamilyGetIpv4RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateAreaAddressFamilyGetIpv4AttributeType(arg *UpdateAreaAddressFamilyGetIpv4AttributeType, val UpdateAreaAddressFamilyGetIpv4RetType) { + *arg = &val +} + // UpdateAreaAddressFamily The addressFamily object for a area update request. type UpdateAreaAddressFamily struct { - Ipv4 *UpdateAreaIPv4 `json:"ipv4,omitempty"` + Ipv4 UpdateAreaAddressFamilyGetIpv4AttributeType `json:"ipv4,omitempty"` } // NewUpdateAreaAddressFamily instantiates a new UpdateAreaAddressFamily object @@ -40,41 +60,32 @@ func NewUpdateAreaAddressFamilyWithDefaults() *UpdateAreaAddressFamily { } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *UpdateAreaAddressFamily) GetIpv4() *UpdateAreaIPv4 { - if o == nil || IsNil(o.Ipv4) { - var ret *UpdateAreaIPv4 - return ret - } - return o.Ipv4 +func (o *UpdateAreaAddressFamily) GetIpv4() (res UpdateAreaAddressFamilyGetIpv4RetType) { + res, _ = o.GetIpv4Ok() + return } // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateAreaAddressFamily) GetIpv4Ok() (*UpdateAreaIPv4, bool) { - if o == nil || IsNil(o.Ipv4) { - return nil, false - } - return o.Ipv4, true +func (o *UpdateAreaAddressFamily) GetIpv4Ok() (ret UpdateAreaAddressFamilyGetIpv4RetType, ok bool) { + return getUpdateAreaAddressFamilyGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. func (o *UpdateAreaAddressFamily) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { - return true - } - - return false + _, ok := o.GetIpv4Ok() + return ok } // SetIpv4 gets a reference to the given UpdateAreaIPv4 and assigns it to the Ipv4 field. -func (o *UpdateAreaAddressFamily) SetIpv4(v *UpdateAreaIPv4) { - o.Ipv4 = v +func (o *UpdateAreaAddressFamily) SetIpv4(v UpdateAreaAddressFamilyGetIpv4RetType) { + setUpdateAreaAddressFamilyGetIpv4AttributeType(&o.Ipv4, v) } func (o UpdateAreaAddressFamily) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Ipv4) { - toSerialize["ipv4"] = o.Ipv4 + if val, ok := getUpdateAreaAddressFamilyGetIpv4AttributeTypeOk(o.Ipv4); ok { + toSerialize["Ipv4"] = val } return toSerialize, nil } diff --git a/services/iaas/model_update_area_ipv4.go b/services/iaas/model_update_area_ipv4.go index 2bb172fe1..c458d2703 100644 --- a/services/iaas/model_update_area_ipv4.go +++ b/services/iaas/model_update_area_ipv4.go @@ -17,15 +17,95 @@ import ( // checks if the UpdateAreaIPv4 type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateAreaIPv4{} +/* + types and functions for defaultNameservers +*/ + +// isArray +type UpdateAreaIPv4GetDefaultNameserversAttributeType = *[]string +type UpdateAreaIPv4GetDefaultNameserversArgType = []string +type UpdateAreaIPv4GetDefaultNameserversRetType = []string + +func getUpdateAreaIPv4GetDefaultNameserversAttributeTypeOk(arg UpdateAreaIPv4GetDefaultNameserversAttributeType) (ret UpdateAreaIPv4GetDefaultNameserversRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateAreaIPv4GetDefaultNameserversAttributeType(arg *UpdateAreaIPv4GetDefaultNameserversAttributeType, val UpdateAreaIPv4GetDefaultNameserversRetType) { + *arg = &val +} + +/* + types and functions for defaultPrefixLen +*/ + +// isInteger +type UpdateAreaIPv4GetDefaultPrefixLenAttributeType = *int64 +type UpdateAreaIPv4GetDefaultPrefixLenArgType = int64 +type UpdateAreaIPv4GetDefaultPrefixLenRetType = int64 + +func getUpdateAreaIPv4GetDefaultPrefixLenAttributeTypeOk(arg UpdateAreaIPv4GetDefaultPrefixLenAttributeType) (ret UpdateAreaIPv4GetDefaultPrefixLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateAreaIPv4GetDefaultPrefixLenAttributeType(arg *UpdateAreaIPv4GetDefaultPrefixLenAttributeType, val UpdateAreaIPv4GetDefaultPrefixLenRetType) { + *arg = &val +} + +/* + types and functions for maxPrefixLen +*/ + +// isInteger +type UpdateAreaIPv4GetMaxPrefixLenAttributeType = *int64 +type UpdateAreaIPv4GetMaxPrefixLenArgType = int64 +type UpdateAreaIPv4GetMaxPrefixLenRetType = int64 + +func getUpdateAreaIPv4GetMaxPrefixLenAttributeTypeOk(arg UpdateAreaIPv4GetMaxPrefixLenAttributeType) (ret UpdateAreaIPv4GetMaxPrefixLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateAreaIPv4GetMaxPrefixLenAttributeType(arg *UpdateAreaIPv4GetMaxPrefixLenAttributeType, val UpdateAreaIPv4GetMaxPrefixLenRetType) { + *arg = &val +} + +/* + types and functions for minPrefixLen +*/ + +// isInteger +type UpdateAreaIPv4GetMinPrefixLenAttributeType = *int64 +type UpdateAreaIPv4GetMinPrefixLenArgType = int64 +type UpdateAreaIPv4GetMinPrefixLenRetType = int64 + +func getUpdateAreaIPv4GetMinPrefixLenAttributeTypeOk(arg UpdateAreaIPv4GetMinPrefixLenAttributeType) (ret UpdateAreaIPv4GetMinPrefixLenRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateAreaIPv4GetMinPrefixLenAttributeType(arg *UpdateAreaIPv4GetMinPrefixLenAttributeType, val UpdateAreaIPv4GetMinPrefixLenRetType) { + *arg = &val +} + // UpdateAreaIPv4 The update object for a IPv4 network area. type UpdateAreaIPv4 struct { - DefaultNameservers *[]string `json:"defaultNameservers,omitempty"` + DefaultNameservers UpdateAreaIPv4GetDefaultNameserversAttributeType `json:"defaultNameservers,omitempty"` // The default prefix length for networks in the network area. - DefaultPrefixLen *int64 `json:"defaultPrefixLen,omitempty"` + DefaultPrefixLen UpdateAreaIPv4GetDefaultPrefixLenAttributeType `json:"defaultPrefixLen,omitempty"` // The maximal prefix length for networks in the network area. - MaxPrefixLen *int64 `json:"maxPrefixLen,omitempty"` + MaxPrefixLen UpdateAreaIPv4GetMaxPrefixLenAttributeType `json:"maxPrefixLen,omitempty"` // The minimal prefix length for networks in the network area. - MinPrefixLen *int64 `json:"minPrefixLen,omitempty"` + MinPrefixLen UpdateAreaIPv4GetMinPrefixLenAttributeType `json:"minPrefixLen,omitempty"` } // NewUpdateAreaIPv4 instantiates a new UpdateAreaIPv4 object @@ -46,146 +126,110 @@ func NewUpdateAreaIPv4WithDefaults() *UpdateAreaIPv4 { } // GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. -func (o *UpdateAreaIPv4) GetDefaultNameservers() *[]string { - if o == nil || IsNil(o.DefaultNameservers) { - var ret *[]string - return ret - } - return o.DefaultNameservers +func (o *UpdateAreaIPv4) GetDefaultNameservers() (res UpdateAreaIPv4GetDefaultNameserversRetType) { + res, _ = o.GetDefaultNameserversOk() + return } // GetDefaultNameserversOk returns a tuple with the DefaultNameservers field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateAreaIPv4) GetDefaultNameserversOk() (*[]string, bool) { - if o == nil || IsNil(o.DefaultNameservers) { - return nil, false - } - return o.DefaultNameservers, true +func (o *UpdateAreaIPv4) GetDefaultNameserversOk() (ret UpdateAreaIPv4GetDefaultNameserversRetType, ok bool) { + return getUpdateAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers) } // HasDefaultNameservers returns a boolean if a field has been set. func (o *UpdateAreaIPv4) HasDefaultNameservers() bool { - if o != nil && !IsNil(o.DefaultNameservers) { - return true - } - - return false + _, ok := o.GetDefaultNameserversOk() + return ok } // SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. -func (o *UpdateAreaIPv4) SetDefaultNameservers(v *[]string) { - o.DefaultNameservers = v +func (o *UpdateAreaIPv4) SetDefaultNameservers(v UpdateAreaIPv4GetDefaultNameserversRetType) { + setUpdateAreaIPv4GetDefaultNameserversAttributeType(&o.DefaultNameservers, v) } // GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. -func (o *UpdateAreaIPv4) GetDefaultPrefixLen() *int64 { - if o == nil || IsNil(o.DefaultPrefixLen) { - var ret *int64 - return ret - } - return o.DefaultPrefixLen +func (o *UpdateAreaIPv4) GetDefaultPrefixLen() (res UpdateAreaIPv4GetDefaultPrefixLenRetType) { + res, _ = o.GetDefaultPrefixLenOk() + return } // GetDefaultPrefixLenOk returns a tuple with the DefaultPrefixLen field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateAreaIPv4) GetDefaultPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.DefaultPrefixLen) { - return nil, false - } - return o.DefaultPrefixLen, true +func (o *UpdateAreaIPv4) GetDefaultPrefixLenOk() (ret UpdateAreaIPv4GetDefaultPrefixLenRetType, ok bool) { + return getUpdateAreaIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen) } // HasDefaultPrefixLen returns a boolean if a field has been set. func (o *UpdateAreaIPv4) HasDefaultPrefixLen() bool { - if o != nil && !IsNil(o.DefaultPrefixLen) { - return true - } - - return false + _, ok := o.GetDefaultPrefixLenOk() + return ok } // SetDefaultPrefixLen gets a reference to the given int64 and assigns it to the DefaultPrefixLen field. -func (o *UpdateAreaIPv4) SetDefaultPrefixLen(v *int64) { - o.DefaultPrefixLen = v +func (o *UpdateAreaIPv4) SetDefaultPrefixLen(v UpdateAreaIPv4GetDefaultPrefixLenRetType) { + setUpdateAreaIPv4GetDefaultPrefixLenAttributeType(&o.DefaultPrefixLen, v) } // GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. -func (o *UpdateAreaIPv4) GetMaxPrefixLen() *int64 { - if o == nil || IsNil(o.MaxPrefixLen) { - var ret *int64 - return ret - } - return o.MaxPrefixLen +func (o *UpdateAreaIPv4) GetMaxPrefixLen() (res UpdateAreaIPv4GetMaxPrefixLenRetType) { + res, _ = o.GetMaxPrefixLenOk() + return } // GetMaxPrefixLenOk returns a tuple with the MaxPrefixLen field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateAreaIPv4) GetMaxPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MaxPrefixLen) { - return nil, false - } - return o.MaxPrefixLen, true +func (o *UpdateAreaIPv4) GetMaxPrefixLenOk() (ret UpdateAreaIPv4GetMaxPrefixLenRetType, ok bool) { + return getUpdateAreaIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen) } // HasMaxPrefixLen returns a boolean if a field has been set. func (o *UpdateAreaIPv4) HasMaxPrefixLen() bool { - if o != nil && !IsNil(o.MaxPrefixLen) { - return true - } - - return false + _, ok := o.GetMaxPrefixLenOk() + return ok } // SetMaxPrefixLen gets a reference to the given int64 and assigns it to the MaxPrefixLen field. -func (o *UpdateAreaIPv4) SetMaxPrefixLen(v *int64) { - o.MaxPrefixLen = v +func (o *UpdateAreaIPv4) SetMaxPrefixLen(v UpdateAreaIPv4GetMaxPrefixLenRetType) { + setUpdateAreaIPv4GetMaxPrefixLenAttributeType(&o.MaxPrefixLen, v) } // GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. -func (o *UpdateAreaIPv4) GetMinPrefixLen() *int64 { - if o == nil || IsNil(o.MinPrefixLen) { - var ret *int64 - return ret - } - return o.MinPrefixLen +func (o *UpdateAreaIPv4) GetMinPrefixLen() (res UpdateAreaIPv4GetMinPrefixLenRetType) { + res, _ = o.GetMinPrefixLenOk() + return } // GetMinPrefixLenOk returns a tuple with the MinPrefixLen field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateAreaIPv4) GetMinPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MinPrefixLen) { - return nil, false - } - return o.MinPrefixLen, true +func (o *UpdateAreaIPv4) GetMinPrefixLenOk() (ret UpdateAreaIPv4GetMinPrefixLenRetType, ok bool) { + return getUpdateAreaIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen) } // HasMinPrefixLen returns a boolean if a field has been set. func (o *UpdateAreaIPv4) HasMinPrefixLen() bool { - if o != nil && !IsNil(o.MinPrefixLen) { - return true - } - - return false + _, ok := o.GetMinPrefixLenOk() + return ok } // SetMinPrefixLen gets a reference to the given int64 and assigns it to the MinPrefixLen field. -func (o *UpdateAreaIPv4) SetMinPrefixLen(v *int64) { - o.MinPrefixLen = v +func (o *UpdateAreaIPv4) SetMinPrefixLen(v UpdateAreaIPv4GetMinPrefixLenRetType) { + setUpdateAreaIPv4GetMinPrefixLenAttributeType(&o.MinPrefixLen, v) } func (o UpdateAreaIPv4) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.DefaultNameservers) { - toSerialize["defaultNameservers"] = o.DefaultNameservers + if val, ok := getUpdateAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers); ok { + toSerialize["DefaultNameservers"] = val } - if !IsNil(o.DefaultPrefixLen) { - toSerialize["defaultPrefixLen"] = o.DefaultPrefixLen + if val, ok := getUpdateAreaIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen); ok { + toSerialize["DefaultPrefixLen"] = val } - if !IsNil(o.MaxPrefixLen) { - toSerialize["maxPrefixLen"] = o.MaxPrefixLen + if val, ok := getUpdateAreaIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen); ok { + toSerialize["MaxPrefixLen"] = val } - if !IsNil(o.MinPrefixLen) { - toSerialize["minPrefixLen"] = o.MinPrefixLen + if val, ok := getUpdateAreaIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen); ok { + toSerialize["MinPrefixLen"] = val } return toSerialize, nil } diff --git a/services/iaas/model_update_attached_volume_payload.go b/services/iaas/model_update_attached_volume_payload.go index 1357e3324..ca0117ae5 100644 --- a/services/iaas/model_update_attached_volume_payload.go +++ b/services/iaas/model_update_attached_volume_payload.go @@ -17,14 +17,76 @@ import ( // checks if the UpdateAttachedVolumePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateAttachedVolumePayload{} +/* + types and functions for deleteOnTermination +*/ + +// isBoolean +type UpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeType = *bool +type UpdateAttachedVolumePayloadgetDeleteOnTerminationArgType = bool +type UpdateAttachedVolumePayloadgetDeleteOnTerminationRetType = bool + +func getUpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeTypeOk(arg UpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeType) (ret UpdateAttachedVolumePayloadgetDeleteOnTerminationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeType(arg *UpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeType, val UpdateAttachedVolumePayloadgetDeleteOnTerminationRetType) { + *arg = &val +} + +/* + types and functions for serverId +*/ + +// isNotNullableString +type UpdateAttachedVolumePayloadGetServerIdAttributeType = *string + +func getUpdateAttachedVolumePayloadGetServerIdAttributeTypeOk(arg UpdateAttachedVolumePayloadGetServerIdAttributeType) (ret UpdateAttachedVolumePayloadGetServerIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateAttachedVolumePayloadGetServerIdAttributeType(arg *UpdateAttachedVolumePayloadGetServerIdAttributeType, val UpdateAttachedVolumePayloadGetServerIdRetType) { + *arg = &val +} + +type UpdateAttachedVolumePayloadGetServerIdArgType = string +type UpdateAttachedVolumePayloadGetServerIdRetType = string + +/* + types and functions for volumeId +*/ + +// isNotNullableString +type UpdateAttachedVolumePayloadGetVolumeIdAttributeType = *string + +func getUpdateAttachedVolumePayloadGetVolumeIdAttributeTypeOk(arg UpdateAttachedVolumePayloadGetVolumeIdAttributeType) (ret UpdateAttachedVolumePayloadGetVolumeIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateAttachedVolumePayloadGetVolumeIdAttributeType(arg *UpdateAttachedVolumePayloadGetVolumeIdAttributeType, val UpdateAttachedVolumePayloadGetVolumeIdRetType) { + *arg = &val +} + +type UpdateAttachedVolumePayloadGetVolumeIdArgType = string +type UpdateAttachedVolumePayloadGetVolumeIdRetType = string + // UpdateAttachedVolumePayload Object that represents a Volume attachment to a server. type UpdateAttachedVolumePayload struct { // Delete the volume during the termination of the server. Defaults to false. - DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` + DeleteOnTermination UpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeType `json:"deleteOnTermination,omitempty"` // Universally Unique Identifier (UUID). - ServerId *string `json:"serverId,omitempty"` + ServerId UpdateAttachedVolumePayloadGetServerIdAttributeType `json:"serverId,omitempty"` // Universally Unique Identifier (UUID). - VolumeId *string `json:"volumeId,omitempty"` + VolumeId UpdateAttachedVolumePayloadGetVolumeIdAttributeType `json:"volumeId,omitempty"` } // NewUpdateAttachedVolumePayload instantiates a new UpdateAttachedVolumePayload object @@ -45,111 +107,84 @@ func NewUpdateAttachedVolumePayloadWithDefaults() *UpdateAttachedVolumePayload { } // GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. -func (o *UpdateAttachedVolumePayload) GetDeleteOnTermination() *bool { - if o == nil || IsNil(o.DeleteOnTermination) { - var ret *bool - return ret - } - return o.DeleteOnTermination +func (o *UpdateAttachedVolumePayload) GetDeleteOnTermination() (res UpdateAttachedVolumePayloadgetDeleteOnTerminationRetType) { + res, _ = o.GetDeleteOnTerminationOk() + return } // GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateAttachedVolumePayload) GetDeleteOnTerminationOk() (*bool, bool) { - if o == nil || IsNil(o.DeleteOnTermination) { - return nil, false - } - return o.DeleteOnTermination, true +func (o *UpdateAttachedVolumePayload) GetDeleteOnTerminationOk() (ret UpdateAttachedVolumePayloadgetDeleteOnTerminationRetType, ok bool) { + return getUpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination) } // HasDeleteOnTermination returns a boolean if a field has been set. func (o *UpdateAttachedVolumePayload) HasDeleteOnTermination() bool { - if o != nil && !IsNil(o.DeleteOnTermination) { - return true - } - - return false + _, ok := o.GetDeleteOnTerminationOk() + return ok } // SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. -func (o *UpdateAttachedVolumePayload) SetDeleteOnTermination(v *bool) { - o.DeleteOnTermination = v +func (o *UpdateAttachedVolumePayload) SetDeleteOnTermination(v UpdateAttachedVolumePayloadgetDeleteOnTerminationRetType) { + setUpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeType(&o.DeleteOnTermination, v) } // GetServerId returns the ServerId field value if set, zero value otherwise. -func (o *UpdateAttachedVolumePayload) GetServerId() *string { - if o == nil || IsNil(o.ServerId) { - var ret *string - return ret - } - return o.ServerId +func (o *UpdateAttachedVolumePayload) GetServerId() (res UpdateAttachedVolumePayloadGetServerIdRetType) { + res, _ = o.GetServerIdOk() + return } // GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateAttachedVolumePayload) GetServerIdOk() (*string, bool) { - if o == nil || IsNil(o.ServerId) { - return nil, false - } - return o.ServerId, true +func (o *UpdateAttachedVolumePayload) GetServerIdOk() (ret UpdateAttachedVolumePayloadGetServerIdRetType, ok bool) { + return getUpdateAttachedVolumePayloadGetServerIdAttributeTypeOk(o.ServerId) } // HasServerId returns a boolean if a field has been set. func (o *UpdateAttachedVolumePayload) HasServerId() bool { - if o != nil && !IsNil(o.ServerId) { - return true - } - - return false + _, ok := o.GetServerIdOk() + return ok } // SetServerId gets a reference to the given string and assigns it to the ServerId field. -func (o *UpdateAttachedVolumePayload) SetServerId(v *string) { - o.ServerId = v +func (o *UpdateAttachedVolumePayload) SetServerId(v UpdateAttachedVolumePayloadGetServerIdRetType) { + setUpdateAttachedVolumePayloadGetServerIdAttributeType(&o.ServerId, v) } // GetVolumeId returns the VolumeId field value if set, zero value otherwise. -func (o *UpdateAttachedVolumePayload) GetVolumeId() *string { - if o == nil || IsNil(o.VolumeId) { - var ret *string - return ret - } - return o.VolumeId +func (o *UpdateAttachedVolumePayload) GetVolumeId() (res UpdateAttachedVolumePayloadGetVolumeIdRetType) { + res, _ = o.GetVolumeIdOk() + return } // GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateAttachedVolumePayload) GetVolumeIdOk() (*string, bool) { - if o == nil || IsNil(o.VolumeId) { - return nil, false - } - return o.VolumeId, true +func (o *UpdateAttachedVolumePayload) GetVolumeIdOk() (ret UpdateAttachedVolumePayloadGetVolumeIdRetType, ok bool) { + return getUpdateAttachedVolumePayloadGetVolumeIdAttributeTypeOk(o.VolumeId) } // HasVolumeId returns a boolean if a field has been set. func (o *UpdateAttachedVolumePayload) HasVolumeId() bool { - if o != nil && !IsNil(o.VolumeId) { - return true - } - - return false + _, ok := o.GetVolumeIdOk() + return ok } // SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. -func (o *UpdateAttachedVolumePayload) SetVolumeId(v *string) { - o.VolumeId = v +func (o *UpdateAttachedVolumePayload) SetVolumeId(v UpdateAttachedVolumePayloadGetVolumeIdRetType) { + setUpdateAttachedVolumePayloadGetVolumeIdAttributeType(&o.VolumeId, v) } func (o UpdateAttachedVolumePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.DeleteOnTermination) { - toSerialize["deleteOnTermination"] = o.DeleteOnTermination + if val, ok := getUpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination); ok { + toSerialize["DeleteOnTermination"] = val } - if !IsNil(o.ServerId) { - toSerialize["serverId"] = o.ServerId + if val, ok := getUpdateAttachedVolumePayloadGetServerIdAttributeTypeOk(o.ServerId); ok { + toSerialize["ServerId"] = val } - if !IsNil(o.VolumeId) { - toSerialize["volumeId"] = o.VolumeId + if val, ok := getUpdateAttachedVolumePayloadGetVolumeIdAttributeTypeOk(o.VolumeId); ok { + toSerialize["VolumeId"] = val } return toSerialize, nil } diff --git a/services/iaas/model_update_backup_payload.go b/services/iaas/model_update_backup_payload.go index 41bd159de..cbd6266bf 100644 --- a/services/iaas/model_update_backup_payload.go +++ b/services/iaas/model_update_backup_payload.go @@ -18,28 +18,234 @@ import ( // checks if the UpdateBackupPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateBackupPayload{} +/* + types and functions for availabilityZone +*/ + +// isNotNullableString +type UpdateBackupPayloadGetAvailabilityZoneAttributeType = *string + +func getUpdateBackupPayloadGetAvailabilityZoneAttributeTypeOk(arg UpdateBackupPayloadGetAvailabilityZoneAttributeType) (ret UpdateBackupPayloadGetAvailabilityZoneRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateBackupPayloadGetAvailabilityZoneAttributeType(arg *UpdateBackupPayloadGetAvailabilityZoneAttributeType, val UpdateBackupPayloadGetAvailabilityZoneRetType) { + *arg = &val +} + +type UpdateBackupPayloadGetAvailabilityZoneArgType = string +type UpdateBackupPayloadGetAvailabilityZoneRetType = string + +/* + types and functions for createdAt +*/ + +// isDateTime +type UpdateBackupPayloadGetCreatedAtAttributeType = *time.Time +type UpdateBackupPayloadGetCreatedAtArgType = time.Time +type UpdateBackupPayloadGetCreatedAtRetType = time.Time + +func getUpdateBackupPayloadGetCreatedAtAttributeTypeOk(arg UpdateBackupPayloadGetCreatedAtAttributeType) (ret UpdateBackupPayloadGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateBackupPayloadGetCreatedAtAttributeType(arg *UpdateBackupPayloadGetCreatedAtAttributeType, val UpdateBackupPayloadGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +type UpdateBackupPayloadGetIdAttributeType = *string + +func getUpdateBackupPayloadGetIdAttributeTypeOk(arg UpdateBackupPayloadGetIdAttributeType) (ret UpdateBackupPayloadGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateBackupPayloadGetIdAttributeType(arg *UpdateBackupPayloadGetIdAttributeType, val UpdateBackupPayloadGetIdRetType) { + *arg = &val +} + +type UpdateBackupPayloadGetIdArgType = string +type UpdateBackupPayloadGetIdRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type UpdateBackupPayloadGetLabelsAttributeType = *map[string]interface{} +type UpdateBackupPayloadGetLabelsArgType = map[string]interface{} +type UpdateBackupPayloadGetLabelsRetType = map[string]interface{} + +func getUpdateBackupPayloadGetLabelsAttributeTypeOk(arg UpdateBackupPayloadGetLabelsAttributeType) (ret UpdateBackupPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateBackupPayloadGetLabelsAttributeType(arg *UpdateBackupPayloadGetLabelsAttributeType, val UpdateBackupPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type UpdateBackupPayloadGetNameAttributeType = *string + +func getUpdateBackupPayloadGetNameAttributeTypeOk(arg UpdateBackupPayloadGetNameAttributeType) (ret UpdateBackupPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateBackupPayloadGetNameAttributeType(arg *UpdateBackupPayloadGetNameAttributeType, val UpdateBackupPayloadGetNameRetType) { + *arg = &val +} + +type UpdateBackupPayloadGetNameArgType = string +type UpdateBackupPayloadGetNameRetType = string + +/* + types and functions for size +*/ + +// isLong +type UpdateBackupPayloadGetSizeAttributeType = *int64 +type UpdateBackupPayloadGetSizeArgType = int64 +type UpdateBackupPayloadGetSizeRetType = int64 + +func getUpdateBackupPayloadGetSizeAttributeTypeOk(arg UpdateBackupPayloadGetSizeAttributeType) (ret UpdateBackupPayloadGetSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateBackupPayloadGetSizeAttributeType(arg *UpdateBackupPayloadGetSizeAttributeType, val UpdateBackupPayloadGetSizeRetType) { + *arg = &val +} + +/* + types and functions for snapshotId +*/ + +// isNotNullableString +type UpdateBackupPayloadGetSnapshotIdAttributeType = *string + +func getUpdateBackupPayloadGetSnapshotIdAttributeTypeOk(arg UpdateBackupPayloadGetSnapshotIdAttributeType) (ret UpdateBackupPayloadGetSnapshotIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateBackupPayloadGetSnapshotIdAttributeType(arg *UpdateBackupPayloadGetSnapshotIdAttributeType, val UpdateBackupPayloadGetSnapshotIdRetType) { + *arg = &val +} + +type UpdateBackupPayloadGetSnapshotIdArgType = string +type UpdateBackupPayloadGetSnapshotIdRetType = string + +/* + types and functions for status +*/ + +// isNotNullableString +type UpdateBackupPayloadGetStatusAttributeType = *string + +func getUpdateBackupPayloadGetStatusAttributeTypeOk(arg UpdateBackupPayloadGetStatusAttributeType) (ret UpdateBackupPayloadGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateBackupPayloadGetStatusAttributeType(arg *UpdateBackupPayloadGetStatusAttributeType, val UpdateBackupPayloadGetStatusRetType) { + *arg = &val +} + +type UpdateBackupPayloadGetStatusArgType = string +type UpdateBackupPayloadGetStatusRetType = string + +/* + types and functions for updatedAt +*/ + +// isDateTime +type UpdateBackupPayloadGetUpdatedAtAttributeType = *time.Time +type UpdateBackupPayloadGetUpdatedAtArgType = time.Time +type UpdateBackupPayloadGetUpdatedAtRetType = time.Time + +func getUpdateBackupPayloadGetUpdatedAtAttributeTypeOk(arg UpdateBackupPayloadGetUpdatedAtAttributeType) (ret UpdateBackupPayloadGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateBackupPayloadGetUpdatedAtAttributeType(arg *UpdateBackupPayloadGetUpdatedAtAttributeType, val UpdateBackupPayloadGetUpdatedAtRetType) { + *arg = &val +} + +/* + types and functions for volumeId +*/ + +// isNotNullableString +type UpdateBackupPayloadGetVolumeIdAttributeType = *string + +func getUpdateBackupPayloadGetVolumeIdAttributeTypeOk(arg UpdateBackupPayloadGetVolumeIdAttributeType) (ret UpdateBackupPayloadGetVolumeIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateBackupPayloadGetVolumeIdAttributeType(arg *UpdateBackupPayloadGetVolumeIdAttributeType, val UpdateBackupPayloadGetVolumeIdRetType) { + *arg = &val +} + +type UpdateBackupPayloadGetVolumeIdArgType = string +type UpdateBackupPayloadGetVolumeIdRetType = string + // UpdateBackupPayload Object that represents a backup. type UpdateBackupPayload struct { // Object that represents an availability zone. - AvailabilityZone *string `json:"availabilityZone,omitempty"` + AvailabilityZone UpdateBackupPayloadGetAvailabilityZoneAttributeType `json:"availabilityZone,omitempty"` // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt UpdateBackupPayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id UpdateBackupPayloadGetIdAttributeType `json:"id,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels UpdateBackupPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty"` + Name UpdateBackupPayloadGetNameAttributeType `json:"name,omitempty"` // Size in Gigabyte. - Size *int64 `json:"size,omitempty"` + Size UpdateBackupPayloadGetSizeAttributeType `json:"size,omitempty"` // Universally Unique Identifier (UUID). - SnapshotId *string `json:"snapshotId,omitempty"` + SnapshotId UpdateBackupPayloadGetSnapshotIdAttributeType `json:"snapshotId,omitempty"` // The status of a backup object. Possible values: `AVAILABLE`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`. - Status *string `json:"status,omitempty"` + Status UpdateBackupPayloadGetStatusAttributeType `json:"status,omitempty"` // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAt UpdateBackupPayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` // Universally Unique Identifier (UUID). - VolumeId *string `json:"volumeId,omitempty"` + VolumeId UpdateBackupPayloadGetVolumeIdAttributeType `json:"volumeId,omitempty"` } // NewUpdateBackupPayload instantiates a new UpdateBackupPayload object @@ -60,356 +266,266 @@ func NewUpdateBackupPayloadWithDefaults() *UpdateBackupPayload { } // GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetAvailabilityZone() *string { - if o == nil || IsNil(o.AvailabilityZone) { - var ret *string - return ret - } - return o.AvailabilityZone +func (o *UpdateBackupPayload) GetAvailabilityZone() (res UpdateBackupPayloadGetAvailabilityZoneRetType) { + res, _ = o.GetAvailabilityZoneOk() + return } // GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateBackupPayload) GetAvailabilityZoneOk() (*string, bool) { - if o == nil || IsNil(o.AvailabilityZone) { - return nil, false - } - return o.AvailabilityZone, true +func (o *UpdateBackupPayload) GetAvailabilityZoneOk() (ret UpdateBackupPayloadGetAvailabilityZoneRetType, ok bool) { + return getUpdateBackupPayloadGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) } // HasAvailabilityZone returns a boolean if a field has been set. func (o *UpdateBackupPayload) HasAvailabilityZone() bool { - if o != nil && !IsNil(o.AvailabilityZone) { - return true - } - - return false + _, ok := o.GetAvailabilityZoneOk() + return ok } // SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. -func (o *UpdateBackupPayload) SetAvailabilityZone(v *string) { - o.AvailabilityZone = v +func (o *UpdateBackupPayload) SetAvailabilityZone(v UpdateBackupPayloadGetAvailabilityZoneRetType) { + setUpdateBackupPayloadGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - return o.CreatedAt +func (o *UpdateBackupPayload) GetCreatedAt() (res UpdateBackupPayloadGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return } // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateBackupPayload) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true +func (o *UpdateBackupPayload) GetCreatedAtOk() (ret UpdateBackupPayloadGetCreatedAtRetType, ok bool) { + return getUpdateBackupPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. func (o *UpdateBackupPayload) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false + _, ok := o.GetCreatedAtOk() + return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *UpdateBackupPayload) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *UpdateBackupPayload) SetCreatedAt(v UpdateBackupPayloadGetCreatedAtRetType) { + setUpdateBackupPayloadGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *UpdateBackupPayload) GetId() (res UpdateBackupPayloadGetIdRetType) { + 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 *UpdateBackupPayload) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *UpdateBackupPayload) GetIdOk() (ret UpdateBackupPayloadGetIdRetType, ok bool) { + return getUpdateBackupPayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *UpdateBackupPayload) 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 *UpdateBackupPayload) SetId(v *string) { - o.Id = v +func (o *UpdateBackupPayload) SetId(v UpdateBackupPayloadGetIdRetType) { + setUpdateBackupPayloadGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *UpdateBackupPayload) GetLabels() (res UpdateBackupPayloadGetLabelsRetType) { + 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 *UpdateBackupPayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *UpdateBackupPayload) GetLabelsOk() (ret UpdateBackupPayloadGetLabelsRetType, ok bool) { + return getUpdateBackupPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *UpdateBackupPayload) 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 *UpdateBackupPayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *UpdateBackupPayload) SetLabels(v UpdateBackupPayloadGetLabelsRetType) { + setUpdateBackupPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *UpdateBackupPayload) GetName() (res UpdateBackupPayloadGetNameRetType) { + 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 *UpdateBackupPayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *UpdateBackupPayload) GetNameOk() (ret UpdateBackupPayloadGetNameRetType, ok bool) { + return getUpdateBackupPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *UpdateBackupPayload) 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 *UpdateBackupPayload) SetName(v *string) { - o.Name = v +func (o *UpdateBackupPayload) SetName(v UpdateBackupPayloadGetNameRetType) { + setUpdateBackupPayloadGetNameAttributeType(&o.Name, v) } // GetSize returns the Size field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetSize() *int64 { - if o == nil || IsNil(o.Size) { - var ret *int64 - return ret - } - return o.Size +func (o *UpdateBackupPayload) GetSize() (res UpdateBackupPayloadGetSizeRetType) { + 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 *UpdateBackupPayload) GetSizeOk() (*int64, bool) { - if o == nil || IsNil(o.Size) { - return nil, false - } - return o.Size, true +func (o *UpdateBackupPayload) GetSizeOk() (ret UpdateBackupPayloadGetSizeRetType, ok bool) { + return getUpdateBackupPayloadGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. func (o *UpdateBackupPayload) 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 *UpdateBackupPayload) SetSize(v *int64) { - o.Size = v +func (o *UpdateBackupPayload) SetSize(v UpdateBackupPayloadGetSizeRetType) { + setUpdateBackupPayloadGetSizeAttributeType(&o.Size, v) } // GetSnapshotId returns the SnapshotId field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetSnapshotId() *string { - if o == nil || IsNil(o.SnapshotId) { - var ret *string - return ret - } - return o.SnapshotId +func (o *UpdateBackupPayload) GetSnapshotId() (res UpdateBackupPayloadGetSnapshotIdRetType) { + res, _ = o.GetSnapshotIdOk() + return } // GetSnapshotIdOk returns a tuple with the SnapshotId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateBackupPayload) GetSnapshotIdOk() (*string, bool) { - if o == nil || IsNil(o.SnapshotId) { - return nil, false - } - return o.SnapshotId, true +func (o *UpdateBackupPayload) GetSnapshotIdOk() (ret UpdateBackupPayloadGetSnapshotIdRetType, ok bool) { + return getUpdateBackupPayloadGetSnapshotIdAttributeTypeOk(o.SnapshotId) } // HasSnapshotId returns a boolean if a field has been set. func (o *UpdateBackupPayload) HasSnapshotId() bool { - if o != nil && !IsNil(o.SnapshotId) { - return true - } - - return false + _, ok := o.GetSnapshotIdOk() + return ok } // SetSnapshotId gets a reference to the given string and assigns it to the SnapshotId field. -func (o *UpdateBackupPayload) SetSnapshotId(v *string) { - o.SnapshotId = v +func (o *UpdateBackupPayload) SetSnapshotId(v UpdateBackupPayloadGetSnapshotIdRetType) { + setUpdateBackupPayloadGetSnapshotIdAttributeType(&o.SnapshotId, v) } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - return o.Status +func (o *UpdateBackupPayload) GetStatus() (res UpdateBackupPayloadGetStatusRetType) { + 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 *UpdateBackupPayload) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true +func (o *UpdateBackupPayload) GetStatusOk() (ret UpdateBackupPayloadGetStatusRetType, ok bool) { + return getUpdateBackupPayloadGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. func (o *UpdateBackupPayload) 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 *UpdateBackupPayload) SetStatus(v *string) { - o.Status = v +func (o *UpdateBackupPayload) SetStatus(v UpdateBackupPayloadGetStatusRetType) { + setUpdateBackupPayloadGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetUpdatedAt() *time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret *time.Time - return ret - } - return o.UpdatedAt +func (o *UpdateBackupPayload) GetUpdatedAt() (res UpdateBackupPayloadGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateBackupPayload) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true +func (o *UpdateBackupPayload) GetUpdatedAtOk() (ret UpdateBackupPayloadGetUpdatedAtRetType, ok bool) { + return getUpdateBackupPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. func (o *UpdateBackupPayload) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false + _, ok := o.GetUpdatedAtOk() + return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *UpdateBackupPayload) SetUpdatedAt(v *time.Time) { - o.UpdatedAt = v +func (o *UpdateBackupPayload) SetUpdatedAt(v UpdateBackupPayloadGetUpdatedAtRetType) { + setUpdateBackupPayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) } // GetVolumeId returns the VolumeId field value if set, zero value otherwise. -func (o *UpdateBackupPayload) GetVolumeId() *string { - if o == nil || IsNil(o.VolumeId) { - var ret *string - return ret - } - return o.VolumeId +func (o *UpdateBackupPayload) GetVolumeId() (res UpdateBackupPayloadGetVolumeIdRetType) { + res, _ = o.GetVolumeIdOk() + return } // GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateBackupPayload) GetVolumeIdOk() (*string, bool) { - if o == nil || IsNil(o.VolumeId) { - return nil, false - } - return o.VolumeId, true +func (o *UpdateBackupPayload) GetVolumeIdOk() (ret UpdateBackupPayloadGetVolumeIdRetType, ok bool) { + return getUpdateBackupPayloadGetVolumeIdAttributeTypeOk(o.VolumeId) } // HasVolumeId returns a boolean if a field has been set. func (o *UpdateBackupPayload) HasVolumeId() bool { - if o != nil && !IsNil(o.VolumeId) { - return true - } - - return false + _, ok := o.GetVolumeIdOk() + return ok } // SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. -func (o *UpdateBackupPayload) SetVolumeId(v *string) { - o.VolumeId = v +func (o *UpdateBackupPayload) SetVolumeId(v UpdateBackupPayloadGetVolumeIdRetType) { + setUpdateBackupPayloadGetVolumeIdAttributeType(&o.VolumeId, v) } func (o UpdateBackupPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.AvailabilityZone) { - toSerialize["availabilityZone"] = o.AvailabilityZone + if val, ok := getUpdateBackupPayloadGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { + toSerialize["AvailabilityZone"] = val } - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt + if val, ok := getUpdateBackupPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getUpdateBackupPayloadGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getUpdateBackupPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getUpdateBackupPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Size) { - toSerialize["size"] = o.Size + if val, ok := getUpdateBackupPayloadGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val } - if !IsNil(o.SnapshotId) { - toSerialize["snapshotId"] = o.SnapshotId + if val, ok := getUpdateBackupPayloadGetSnapshotIdAttributeTypeOk(o.SnapshotId); ok { + toSerialize["SnapshotId"] = val } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status + if val, ok := getUpdateBackupPayloadGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt + if val, ok := getUpdateBackupPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val } - if !IsNil(o.VolumeId) { - toSerialize["volumeId"] = o.VolumeId + if val, ok := getUpdateBackupPayloadGetVolumeIdAttributeTypeOk(o.VolumeId); ok { + toSerialize["VolumeId"] = val } return toSerialize, nil } diff --git a/services/iaas/model_update_image_payload.go b/services/iaas/model_update_image_payload.go index 5e622ae6a..c93be5686 100644 --- a/services/iaas/model_update_image_payload.go +++ b/services/iaas/model_update_image_payload.go @@ -17,20 +17,162 @@ import ( // checks if the UpdateImagePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateImagePayload{} +/* + types and functions for config +*/ + +// isModel +type UpdateImagePayloadGetConfigAttributeType = *ImageConfig +type UpdateImagePayloadGetConfigArgType = ImageConfig +type UpdateImagePayloadGetConfigRetType = ImageConfig + +func getUpdateImagePayloadGetConfigAttributeTypeOk(arg UpdateImagePayloadGetConfigAttributeType) (ret UpdateImagePayloadGetConfigRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateImagePayloadGetConfigAttributeType(arg *UpdateImagePayloadGetConfigAttributeType, val UpdateImagePayloadGetConfigRetType) { + *arg = &val +} + +/* + types and functions for diskFormat +*/ + +// isNotNullableString +type UpdateImagePayloadGetDiskFormatAttributeType = *string + +func getUpdateImagePayloadGetDiskFormatAttributeTypeOk(arg UpdateImagePayloadGetDiskFormatAttributeType) (ret UpdateImagePayloadGetDiskFormatRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateImagePayloadGetDiskFormatAttributeType(arg *UpdateImagePayloadGetDiskFormatAttributeType, val UpdateImagePayloadGetDiskFormatRetType) { + *arg = &val +} + +type UpdateImagePayloadGetDiskFormatArgType = string +type UpdateImagePayloadGetDiskFormatRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type UpdateImagePayloadGetLabelsAttributeType = *map[string]interface{} +type UpdateImagePayloadGetLabelsArgType = map[string]interface{} +type UpdateImagePayloadGetLabelsRetType = map[string]interface{} + +func getUpdateImagePayloadGetLabelsAttributeTypeOk(arg UpdateImagePayloadGetLabelsAttributeType) (ret UpdateImagePayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateImagePayloadGetLabelsAttributeType(arg *UpdateImagePayloadGetLabelsAttributeType, val UpdateImagePayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for minDiskSize +*/ + +// isLong +type UpdateImagePayloadGetMinDiskSizeAttributeType = *int64 +type UpdateImagePayloadGetMinDiskSizeArgType = int64 +type UpdateImagePayloadGetMinDiskSizeRetType = int64 + +func getUpdateImagePayloadGetMinDiskSizeAttributeTypeOk(arg UpdateImagePayloadGetMinDiskSizeAttributeType) (ret UpdateImagePayloadGetMinDiskSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateImagePayloadGetMinDiskSizeAttributeType(arg *UpdateImagePayloadGetMinDiskSizeAttributeType, val UpdateImagePayloadGetMinDiskSizeRetType) { + *arg = &val +} + +/* + types and functions for minRam +*/ + +// isLong +type UpdateImagePayloadGetMinRamAttributeType = *int64 +type UpdateImagePayloadGetMinRamArgType = int64 +type UpdateImagePayloadGetMinRamRetType = int64 + +func getUpdateImagePayloadGetMinRamAttributeTypeOk(arg UpdateImagePayloadGetMinRamAttributeType) (ret UpdateImagePayloadGetMinRamRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateImagePayloadGetMinRamAttributeType(arg *UpdateImagePayloadGetMinRamAttributeType, val UpdateImagePayloadGetMinRamRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type UpdateImagePayloadGetNameAttributeType = *string + +func getUpdateImagePayloadGetNameAttributeTypeOk(arg UpdateImagePayloadGetNameAttributeType) (ret UpdateImagePayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateImagePayloadGetNameAttributeType(arg *UpdateImagePayloadGetNameAttributeType, val UpdateImagePayloadGetNameRetType) { + *arg = &val +} + +type UpdateImagePayloadGetNameArgType = string +type UpdateImagePayloadGetNameRetType = string + +/* + types and functions for protected +*/ + +// isBoolean +type UpdateImagePayloadgetProtectedAttributeType = *bool +type UpdateImagePayloadgetProtectedArgType = bool +type UpdateImagePayloadgetProtectedRetType = bool + +func getUpdateImagePayloadgetProtectedAttributeTypeOk(arg UpdateImagePayloadgetProtectedAttributeType) (ret UpdateImagePayloadgetProtectedRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateImagePayloadgetProtectedAttributeType(arg *UpdateImagePayloadgetProtectedAttributeType, val UpdateImagePayloadgetProtectedRetType) { + *arg = &val +} + // UpdateImagePayload Object that represents an update request body of an Image. type UpdateImagePayload struct { - Config *ImageConfig `json:"config,omitempty"` + Config UpdateImagePayloadGetConfigAttributeType `json:"config,omitempty"` // Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`. - DiskFormat *string `json:"diskFormat,omitempty"` + DiskFormat UpdateImagePayloadGetDiskFormatAttributeType `json:"diskFormat,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels UpdateImagePayloadGetLabelsAttributeType `json:"labels,omitempty"` // Size in Gigabyte. - MinDiskSize *int64 `json:"minDiskSize,omitempty"` + MinDiskSize UpdateImagePayloadGetMinDiskSizeAttributeType `json:"minDiskSize,omitempty"` // Size in Megabyte. - MinRam *int64 `json:"minRam,omitempty"` + MinRam UpdateImagePayloadGetMinRamAttributeType `json:"minRam,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty"` - Protected *bool `json:"protected,omitempty"` + Name UpdateImagePayloadGetNameAttributeType `json:"name,omitempty"` + Protected UpdateImagePayloadgetProtectedAttributeType `json:"protected,omitempty"` } // NewUpdateImagePayload instantiates a new UpdateImagePayload object @@ -51,251 +193,188 @@ func NewUpdateImagePayloadWithDefaults() *UpdateImagePayload { } // GetConfig returns the Config field value if set, zero value otherwise. -func (o *UpdateImagePayload) GetConfig() *ImageConfig { - if o == nil || IsNil(o.Config) { - var ret *ImageConfig - return ret - } - return o.Config +func (o *UpdateImagePayload) GetConfig() (res UpdateImagePayloadGetConfigRetType) { + res, _ = o.GetConfigOk() + return } // GetConfigOk returns a tuple with the Config field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateImagePayload) GetConfigOk() (*ImageConfig, bool) { - if o == nil || IsNil(o.Config) { - return nil, false - } - return o.Config, true +func (o *UpdateImagePayload) GetConfigOk() (ret UpdateImagePayloadGetConfigRetType, ok bool) { + return getUpdateImagePayloadGetConfigAttributeTypeOk(o.Config) } // HasConfig returns a boolean if a field has been set. func (o *UpdateImagePayload) HasConfig() bool { - if o != nil && !IsNil(o.Config) { - return true - } - - return false + _, ok := o.GetConfigOk() + return ok } // SetConfig gets a reference to the given ImageConfig and assigns it to the Config field. -func (o *UpdateImagePayload) SetConfig(v *ImageConfig) { - o.Config = v +func (o *UpdateImagePayload) SetConfig(v UpdateImagePayloadGetConfigRetType) { + setUpdateImagePayloadGetConfigAttributeType(&o.Config, v) } // GetDiskFormat returns the DiskFormat field value if set, zero value otherwise. -func (o *UpdateImagePayload) GetDiskFormat() *string { - if o == nil || IsNil(o.DiskFormat) { - var ret *string - return ret - } - return o.DiskFormat +func (o *UpdateImagePayload) GetDiskFormat() (res UpdateImagePayloadGetDiskFormatRetType) { + res, _ = o.GetDiskFormatOk() + return } // GetDiskFormatOk returns a tuple with the DiskFormat field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateImagePayload) GetDiskFormatOk() (*string, bool) { - if o == nil || IsNil(o.DiskFormat) { - return nil, false - } - return o.DiskFormat, true +func (o *UpdateImagePayload) GetDiskFormatOk() (ret UpdateImagePayloadGetDiskFormatRetType, ok bool) { + return getUpdateImagePayloadGetDiskFormatAttributeTypeOk(o.DiskFormat) } // HasDiskFormat returns a boolean if a field has been set. func (o *UpdateImagePayload) HasDiskFormat() bool { - if o != nil && !IsNil(o.DiskFormat) { - return true - } - - return false + _, ok := o.GetDiskFormatOk() + return ok } // SetDiskFormat gets a reference to the given string and assigns it to the DiskFormat field. -func (o *UpdateImagePayload) SetDiskFormat(v *string) { - o.DiskFormat = v +func (o *UpdateImagePayload) SetDiskFormat(v UpdateImagePayloadGetDiskFormatRetType) { + setUpdateImagePayloadGetDiskFormatAttributeType(&o.DiskFormat, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateImagePayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *UpdateImagePayload) GetLabels() (res UpdateImagePayloadGetLabelsRetType) { + 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 *UpdateImagePayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *UpdateImagePayload) GetLabelsOk() (ret UpdateImagePayloadGetLabelsRetType, ok bool) { + return getUpdateImagePayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *UpdateImagePayload) 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 *UpdateImagePayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *UpdateImagePayload) SetLabels(v UpdateImagePayloadGetLabelsRetType) { + setUpdateImagePayloadGetLabelsAttributeType(&o.Labels, v) } // GetMinDiskSize returns the MinDiskSize field value if set, zero value otherwise. -func (o *UpdateImagePayload) GetMinDiskSize() *int64 { - if o == nil || IsNil(o.MinDiskSize) { - var ret *int64 - return ret - } - return o.MinDiskSize +func (o *UpdateImagePayload) GetMinDiskSize() (res UpdateImagePayloadGetMinDiskSizeRetType) { + res, _ = o.GetMinDiskSizeOk() + return } // GetMinDiskSizeOk returns a tuple with the MinDiskSize field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateImagePayload) GetMinDiskSizeOk() (*int64, bool) { - if o == nil || IsNil(o.MinDiskSize) { - return nil, false - } - return o.MinDiskSize, true +func (o *UpdateImagePayload) GetMinDiskSizeOk() (ret UpdateImagePayloadGetMinDiskSizeRetType, ok bool) { + return getUpdateImagePayloadGetMinDiskSizeAttributeTypeOk(o.MinDiskSize) } // HasMinDiskSize returns a boolean if a field has been set. func (o *UpdateImagePayload) HasMinDiskSize() bool { - if o != nil && !IsNil(o.MinDiskSize) { - return true - } - - return false + _, ok := o.GetMinDiskSizeOk() + return ok } // SetMinDiskSize gets a reference to the given int64 and assigns it to the MinDiskSize field. -func (o *UpdateImagePayload) SetMinDiskSize(v *int64) { - o.MinDiskSize = v +func (o *UpdateImagePayload) SetMinDiskSize(v UpdateImagePayloadGetMinDiskSizeRetType) { + setUpdateImagePayloadGetMinDiskSizeAttributeType(&o.MinDiskSize, v) } // GetMinRam returns the MinRam field value if set, zero value otherwise. -func (o *UpdateImagePayload) GetMinRam() *int64 { - if o == nil || IsNil(o.MinRam) { - var ret *int64 - return ret - } - return o.MinRam +func (o *UpdateImagePayload) GetMinRam() (res UpdateImagePayloadGetMinRamRetType) { + res, _ = o.GetMinRamOk() + return } // GetMinRamOk returns a tuple with the MinRam field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateImagePayload) GetMinRamOk() (*int64, bool) { - if o == nil || IsNil(o.MinRam) { - return nil, false - } - return o.MinRam, true +func (o *UpdateImagePayload) GetMinRamOk() (ret UpdateImagePayloadGetMinRamRetType, ok bool) { + return getUpdateImagePayloadGetMinRamAttributeTypeOk(o.MinRam) } // HasMinRam returns a boolean if a field has been set. func (o *UpdateImagePayload) HasMinRam() bool { - if o != nil && !IsNil(o.MinRam) { - return true - } - - return false + _, ok := o.GetMinRamOk() + return ok } // SetMinRam gets a reference to the given int64 and assigns it to the MinRam field. -func (o *UpdateImagePayload) SetMinRam(v *int64) { - o.MinRam = v +func (o *UpdateImagePayload) SetMinRam(v UpdateImagePayloadGetMinRamRetType) { + setUpdateImagePayloadGetMinRamAttributeType(&o.MinRam, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateImagePayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *UpdateImagePayload) GetName() (res UpdateImagePayloadGetNameRetType) { + 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 *UpdateImagePayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *UpdateImagePayload) GetNameOk() (ret UpdateImagePayloadGetNameRetType, ok bool) { + return getUpdateImagePayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *UpdateImagePayload) 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 *UpdateImagePayload) SetName(v *string) { - o.Name = v +func (o *UpdateImagePayload) SetName(v UpdateImagePayloadGetNameRetType) { + setUpdateImagePayloadGetNameAttributeType(&o.Name, v) } // GetProtected returns the Protected field value if set, zero value otherwise. -func (o *UpdateImagePayload) GetProtected() *bool { - if o == nil || IsNil(o.Protected) { - var ret *bool - return ret - } - return o.Protected +func (o *UpdateImagePayload) GetProtected() (res UpdateImagePayloadgetProtectedRetType) { + res, _ = o.GetProtectedOk() + return } // GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateImagePayload) GetProtectedOk() (*bool, bool) { - if o == nil || IsNil(o.Protected) { - return nil, false - } - return o.Protected, true +func (o *UpdateImagePayload) GetProtectedOk() (ret UpdateImagePayloadgetProtectedRetType, ok bool) { + return getUpdateImagePayloadgetProtectedAttributeTypeOk(o.Protected) } // HasProtected returns a boolean if a field has been set. func (o *UpdateImagePayload) HasProtected() bool { - if o != nil && !IsNil(o.Protected) { - return true - } - - return false + _, ok := o.GetProtectedOk() + return ok } // SetProtected gets a reference to the given bool and assigns it to the Protected field. -func (o *UpdateImagePayload) SetProtected(v *bool) { - o.Protected = v +func (o *UpdateImagePayload) SetProtected(v UpdateImagePayloadgetProtectedRetType) { + setUpdateImagePayloadgetProtectedAttributeType(&o.Protected, v) } func (o UpdateImagePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Config) { - toSerialize["config"] = o.Config + if val, ok := getUpdateImagePayloadGetConfigAttributeTypeOk(o.Config); ok { + toSerialize["Config"] = val } - if !IsNil(o.DiskFormat) { - toSerialize["diskFormat"] = o.DiskFormat + if val, ok := getUpdateImagePayloadGetDiskFormatAttributeTypeOk(o.DiskFormat); ok { + toSerialize["DiskFormat"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getUpdateImagePayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.MinDiskSize) { - toSerialize["minDiskSize"] = o.MinDiskSize + if val, ok := getUpdateImagePayloadGetMinDiskSizeAttributeTypeOk(o.MinDiskSize); ok { + toSerialize["MinDiskSize"] = val } - if !IsNil(o.MinRam) { - toSerialize["minRam"] = o.MinRam + if val, ok := getUpdateImagePayloadGetMinRamAttributeTypeOk(o.MinRam); ok { + toSerialize["MinRam"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getUpdateImagePayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Protected) { - toSerialize["protected"] = o.Protected + if val, ok := getUpdateImagePayloadgetProtectedAttributeTypeOk(o.Protected); ok { + toSerialize["Protected"] = val } return toSerialize, nil } diff --git a/services/iaas/model_update_image_share_payload.go b/services/iaas/model_update_image_share_payload.go index 684537c26..0cf90cf34 100644 --- a/services/iaas/model_update_image_share_payload.go +++ b/services/iaas/model_update_image_share_payload.go @@ -17,12 +17,52 @@ import ( // checks if the UpdateImageSharePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateImageSharePayload{} +/* + types and functions for parentOrganization +*/ + +// isBoolean +type UpdateImageSharePayloadgetParentOrganizationAttributeType = *bool +type UpdateImageSharePayloadgetParentOrganizationArgType = bool +type UpdateImageSharePayloadgetParentOrganizationRetType = bool + +func getUpdateImageSharePayloadgetParentOrganizationAttributeTypeOk(arg UpdateImageSharePayloadgetParentOrganizationAttributeType) (ret UpdateImageSharePayloadgetParentOrganizationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateImageSharePayloadgetParentOrganizationAttributeType(arg *UpdateImageSharePayloadgetParentOrganizationAttributeType, val UpdateImageSharePayloadgetParentOrganizationRetType) { + *arg = &val +} + +/* + types and functions for projects +*/ + +// isArray +type UpdateImageSharePayloadGetProjectsAttributeType = *[]string +type UpdateImageSharePayloadGetProjectsArgType = []string +type UpdateImageSharePayloadGetProjectsRetType = []string + +func getUpdateImageSharePayloadGetProjectsAttributeTypeOk(arg UpdateImageSharePayloadGetProjectsAttributeType) (ret UpdateImageSharePayloadGetProjectsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateImageSharePayloadGetProjectsAttributeType(arg *UpdateImageSharePayloadGetProjectsAttributeType, val UpdateImageSharePayloadGetProjectsRetType) { + *arg = &val +} + // UpdateImageSharePayload Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. type UpdateImageSharePayload struct { // Image is shared with all projects inside the image owners organization. - ParentOrganization *bool `json:"parentOrganization,omitempty"` + ParentOrganization UpdateImageSharePayloadgetParentOrganizationAttributeType `json:"parentOrganization,omitempty"` // List of all projects the Image is shared with. - Projects *[]string `json:"projects,omitempty"` + Projects UpdateImageSharePayloadGetProjectsAttributeType `json:"projects,omitempty"` } // NewUpdateImageSharePayload instantiates a new UpdateImageSharePayload object @@ -43,76 +83,58 @@ func NewUpdateImageSharePayloadWithDefaults() *UpdateImageSharePayload { } // GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. -func (o *UpdateImageSharePayload) GetParentOrganization() *bool { - if o == nil || IsNil(o.ParentOrganization) { - var ret *bool - return ret - } - return o.ParentOrganization +func (o *UpdateImageSharePayload) GetParentOrganization() (res UpdateImageSharePayloadgetParentOrganizationRetType) { + res, _ = o.GetParentOrganizationOk() + return } // GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateImageSharePayload) GetParentOrganizationOk() (*bool, bool) { - if o == nil || IsNil(o.ParentOrganization) { - return nil, false - } - return o.ParentOrganization, true +func (o *UpdateImageSharePayload) GetParentOrganizationOk() (ret UpdateImageSharePayloadgetParentOrganizationRetType, ok bool) { + return getUpdateImageSharePayloadgetParentOrganizationAttributeTypeOk(o.ParentOrganization) } // HasParentOrganization returns a boolean if a field has been set. func (o *UpdateImageSharePayload) HasParentOrganization() bool { - if o != nil && !IsNil(o.ParentOrganization) { - return true - } - - return false + _, ok := o.GetParentOrganizationOk() + return ok } // SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. -func (o *UpdateImageSharePayload) SetParentOrganization(v *bool) { - o.ParentOrganization = v +func (o *UpdateImageSharePayload) SetParentOrganization(v UpdateImageSharePayloadgetParentOrganizationRetType) { + setUpdateImageSharePayloadgetParentOrganizationAttributeType(&o.ParentOrganization, v) } // GetProjects returns the Projects field value if set, zero value otherwise. -func (o *UpdateImageSharePayload) GetProjects() *[]string { - if o == nil || IsNil(o.Projects) { - var ret *[]string - return ret - } - return o.Projects +func (o *UpdateImageSharePayload) GetProjects() (res UpdateImageSharePayloadGetProjectsRetType) { + res, _ = o.GetProjectsOk() + return } // GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateImageSharePayload) GetProjectsOk() (*[]string, bool) { - if o == nil || IsNil(o.Projects) { - return nil, false - } - return o.Projects, true +func (o *UpdateImageSharePayload) GetProjectsOk() (ret UpdateImageSharePayloadGetProjectsRetType, ok bool) { + return getUpdateImageSharePayloadGetProjectsAttributeTypeOk(o.Projects) } // HasProjects returns a boolean if a field has been set. func (o *UpdateImageSharePayload) HasProjects() bool { - if o != nil && !IsNil(o.Projects) { - return true - } - - return false + _, ok := o.GetProjectsOk() + return ok } // SetProjects gets a reference to the given []string and assigns it to the Projects field. -func (o *UpdateImageSharePayload) SetProjects(v *[]string) { - o.Projects = v +func (o *UpdateImageSharePayload) SetProjects(v UpdateImageSharePayloadGetProjectsRetType) { + setUpdateImageSharePayloadGetProjectsAttributeType(&o.Projects, v) } func (o UpdateImageSharePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.ParentOrganization) { - toSerialize["parentOrganization"] = o.ParentOrganization + if val, ok := getUpdateImageSharePayloadgetParentOrganizationAttributeTypeOk(o.ParentOrganization); ok { + toSerialize["ParentOrganization"] = val } - if !IsNil(o.Projects) { - toSerialize["projects"] = o.Projects + if val, ok := getUpdateImageSharePayloadGetProjectsAttributeTypeOk(o.Projects); ok { + toSerialize["Projects"] = val } return toSerialize, nil } diff --git a/services/iaas/model_update_key_pair_payload.go b/services/iaas/model_update_key_pair_payload.go index 0d7ecb4a5..60da42efb 100644 --- a/services/iaas/model_update_key_pair_payload.go +++ b/services/iaas/model_update_key_pair_payload.go @@ -17,10 +17,30 @@ import ( // checks if the UpdateKeyPairPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateKeyPairPayload{} +/* + types and functions for labels +*/ + +// isFreeform +type UpdateKeyPairPayloadGetLabelsAttributeType = *map[string]interface{} +type UpdateKeyPairPayloadGetLabelsArgType = map[string]interface{} +type UpdateKeyPairPayloadGetLabelsRetType = map[string]interface{} + +func getUpdateKeyPairPayloadGetLabelsAttributeTypeOk(arg UpdateKeyPairPayloadGetLabelsAttributeType) (ret UpdateKeyPairPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateKeyPairPayloadGetLabelsAttributeType(arg *UpdateKeyPairPayloadGetLabelsAttributeType, val UpdateKeyPairPayloadGetLabelsRetType) { + *arg = &val +} + // UpdateKeyPairPayload Object that represents an update request body of a public key of an SSH keypair. type UpdateKeyPairPayload struct { // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels UpdateKeyPairPayloadGetLabelsAttributeType `json:"labels,omitempty"` } // NewUpdateKeyPairPayload instantiates a new UpdateKeyPairPayload object @@ -41,41 +61,32 @@ func NewUpdateKeyPairPayloadWithDefaults() *UpdateKeyPairPayload { } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateKeyPairPayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *UpdateKeyPairPayload) GetLabels() (res UpdateKeyPairPayloadGetLabelsRetType) { + 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 *UpdateKeyPairPayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *UpdateKeyPairPayload) GetLabelsOk() (ret UpdateKeyPairPayloadGetLabelsRetType, ok bool) { + return getUpdateKeyPairPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *UpdateKeyPairPayload) 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 *UpdateKeyPairPayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *UpdateKeyPairPayload) SetLabels(v UpdateKeyPairPayloadGetLabelsRetType) { + setUpdateKeyPairPayloadGetLabelsAttributeType(&o.Labels, v) } func (o UpdateKeyPairPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getUpdateKeyPairPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } return toSerialize, nil } diff --git a/services/iaas/model_update_network_address_family.go b/services/iaas/model_update_network_address_family.go index c17c3e9e0..aaefe91ae 100644 --- a/services/iaas/model_update_network_address_family.go +++ b/services/iaas/model_update_network_address_family.go @@ -17,10 +17,50 @@ import ( // checks if the UpdateNetworkAddressFamily type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateNetworkAddressFamily{} +/* + types and functions for ipv4 +*/ + +// isModel +type UpdateNetworkAddressFamilyGetIpv4AttributeType = *UpdateNetworkIPv4Body +type UpdateNetworkAddressFamilyGetIpv4ArgType = UpdateNetworkIPv4Body +type UpdateNetworkAddressFamilyGetIpv4RetType = UpdateNetworkIPv4Body + +func getUpdateNetworkAddressFamilyGetIpv4AttributeTypeOk(arg UpdateNetworkAddressFamilyGetIpv4AttributeType) (ret UpdateNetworkAddressFamilyGetIpv4RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateNetworkAddressFamilyGetIpv4AttributeType(arg *UpdateNetworkAddressFamilyGetIpv4AttributeType, val UpdateNetworkAddressFamilyGetIpv4RetType) { + *arg = &val +} + +/* + types and functions for ipv6 +*/ + +// isModel +type UpdateNetworkAddressFamilyGetIpv6AttributeType = *UpdateNetworkIPv6Body +type UpdateNetworkAddressFamilyGetIpv6ArgType = UpdateNetworkIPv6Body +type UpdateNetworkAddressFamilyGetIpv6RetType = UpdateNetworkIPv6Body + +func getUpdateNetworkAddressFamilyGetIpv6AttributeTypeOk(arg UpdateNetworkAddressFamilyGetIpv6AttributeType) (ret UpdateNetworkAddressFamilyGetIpv6RetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateNetworkAddressFamilyGetIpv6AttributeType(arg *UpdateNetworkAddressFamilyGetIpv6AttributeType, val UpdateNetworkAddressFamilyGetIpv6RetType) { + *arg = &val +} + // UpdateNetworkAddressFamily The addressFamily object for a network update request. type UpdateNetworkAddressFamily struct { - Ipv4 *UpdateNetworkIPv4Body `json:"ipv4,omitempty"` - Ipv6 *UpdateNetworkIPv6Body `json:"ipv6,omitempty"` + Ipv4 UpdateNetworkAddressFamilyGetIpv4AttributeType `json:"ipv4,omitempty"` + Ipv6 UpdateNetworkAddressFamilyGetIpv6AttributeType `json:"ipv6,omitempty"` } // NewUpdateNetworkAddressFamily instantiates a new UpdateNetworkAddressFamily object @@ -41,76 +81,58 @@ func NewUpdateNetworkAddressFamilyWithDefaults() *UpdateNetworkAddressFamily { } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. -func (o *UpdateNetworkAddressFamily) GetIpv4() *UpdateNetworkIPv4Body { - if o == nil || IsNil(o.Ipv4) { - var ret *UpdateNetworkIPv4Body - return ret - } - return o.Ipv4 +func (o *UpdateNetworkAddressFamily) GetIpv4() (res UpdateNetworkAddressFamilyGetIpv4RetType) { + res, _ = o.GetIpv4Ok() + return } // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateNetworkAddressFamily) GetIpv4Ok() (*UpdateNetworkIPv4Body, bool) { - if o == nil || IsNil(o.Ipv4) { - return nil, false - } - return o.Ipv4, true +func (o *UpdateNetworkAddressFamily) GetIpv4Ok() (ret UpdateNetworkAddressFamilyGetIpv4RetType, ok bool) { + return getUpdateNetworkAddressFamilyGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. func (o *UpdateNetworkAddressFamily) HasIpv4() bool { - if o != nil && !IsNil(o.Ipv4) { - return true - } - - return false + _, ok := o.GetIpv4Ok() + return ok } // SetIpv4 gets a reference to the given UpdateNetworkIPv4Body and assigns it to the Ipv4 field. -func (o *UpdateNetworkAddressFamily) SetIpv4(v *UpdateNetworkIPv4Body) { - o.Ipv4 = v +func (o *UpdateNetworkAddressFamily) SetIpv4(v UpdateNetworkAddressFamilyGetIpv4RetType) { + setUpdateNetworkAddressFamilyGetIpv4AttributeType(&o.Ipv4, v) } // GetIpv6 returns the Ipv6 field value if set, zero value otherwise. -func (o *UpdateNetworkAddressFamily) GetIpv6() *UpdateNetworkIPv6Body { - if o == nil || IsNil(o.Ipv6) { - var ret *UpdateNetworkIPv6Body - return ret - } - return o.Ipv6 +func (o *UpdateNetworkAddressFamily) GetIpv6() (res UpdateNetworkAddressFamilyGetIpv6RetType) { + res, _ = o.GetIpv6Ok() + return } // GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateNetworkAddressFamily) GetIpv6Ok() (*UpdateNetworkIPv6Body, bool) { - if o == nil || IsNil(o.Ipv6) { - return nil, false - } - return o.Ipv6, true +func (o *UpdateNetworkAddressFamily) GetIpv6Ok() (ret UpdateNetworkAddressFamilyGetIpv6RetType, ok bool) { + return getUpdateNetworkAddressFamilyGetIpv6AttributeTypeOk(o.Ipv6) } // HasIpv6 returns a boolean if a field has been set. func (o *UpdateNetworkAddressFamily) HasIpv6() bool { - if o != nil && !IsNil(o.Ipv6) { - return true - } - - return false + _, ok := o.GetIpv6Ok() + return ok } // SetIpv6 gets a reference to the given UpdateNetworkIPv6Body and assigns it to the Ipv6 field. -func (o *UpdateNetworkAddressFamily) SetIpv6(v *UpdateNetworkIPv6Body) { - o.Ipv6 = v +func (o *UpdateNetworkAddressFamily) SetIpv6(v UpdateNetworkAddressFamilyGetIpv6RetType) { + setUpdateNetworkAddressFamilyGetIpv6AttributeType(&o.Ipv6, v) } func (o UpdateNetworkAddressFamily) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Ipv4) { - toSerialize["ipv4"] = o.Ipv4 + if val, ok := getUpdateNetworkAddressFamilyGetIpv4AttributeTypeOk(o.Ipv4); ok { + toSerialize["Ipv4"] = val } - if !IsNil(o.Ipv6) { - toSerialize["ipv6"] = o.Ipv6 + if val, ok := getUpdateNetworkAddressFamilyGetIpv6AttributeTypeOk(o.Ipv6); ok { + toSerialize["Ipv6"] = val } return toSerialize, nil } diff --git a/services/iaas/model_update_network_area_route_payload.go b/services/iaas/model_update_network_area_route_payload.go index 1655dff76..a7f118373 100644 --- a/services/iaas/model_update_network_area_route_payload.go +++ b/services/iaas/model_update_network_area_route_payload.go @@ -17,10 +17,30 @@ import ( // checks if the UpdateNetworkAreaRoutePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateNetworkAreaRoutePayload{} +/* + types and functions for labels +*/ + +// isFreeform +type UpdateNetworkAreaRoutePayloadGetLabelsAttributeType = *map[string]interface{} +type UpdateNetworkAreaRoutePayloadGetLabelsArgType = map[string]interface{} +type UpdateNetworkAreaRoutePayloadGetLabelsRetType = map[string]interface{} + +func getUpdateNetworkAreaRoutePayloadGetLabelsAttributeTypeOk(arg UpdateNetworkAreaRoutePayloadGetLabelsAttributeType) (ret UpdateNetworkAreaRoutePayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateNetworkAreaRoutePayloadGetLabelsAttributeType(arg *UpdateNetworkAreaRoutePayloadGetLabelsAttributeType, val UpdateNetworkAreaRoutePayloadGetLabelsRetType) { + *arg = &val +} + // UpdateNetworkAreaRoutePayload Object that represents the request body for a route update. type UpdateNetworkAreaRoutePayload struct { // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels UpdateNetworkAreaRoutePayloadGetLabelsAttributeType `json:"labels,omitempty"` } // NewUpdateNetworkAreaRoutePayload instantiates a new UpdateNetworkAreaRoutePayload object @@ -41,41 +61,32 @@ func NewUpdateNetworkAreaRoutePayloadWithDefaults() *UpdateNetworkAreaRoutePaylo } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateNetworkAreaRoutePayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *UpdateNetworkAreaRoutePayload) GetLabels() (res UpdateNetworkAreaRoutePayloadGetLabelsRetType) { + 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 *UpdateNetworkAreaRoutePayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *UpdateNetworkAreaRoutePayload) GetLabelsOk() (ret UpdateNetworkAreaRoutePayloadGetLabelsRetType, ok bool) { + return getUpdateNetworkAreaRoutePayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *UpdateNetworkAreaRoutePayload) 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 *UpdateNetworkAreaRoutePayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *UpdateNetworkAreaRoutePayload) SetLabels(v UpdateNetworkAreaRoutePayloadGetLabelsRetType) { + setUpdateNetworkAreaRoutePayloadGetLabelsAttributeType(&o.Labels, v) } func (o UpdateNetworkAreaRoutePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getUpdateNetworkAreaRoutePayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } return toSerialize, nil } diff --git a/services/iaas/model_update_network_ipv4_body.go b/services/iaas/model_update_network_ipv4_body.go index 546385e8c..80392f7d7 100644 --- a/services/iaas/model_update_network_ipv4_body.go +++ b/services/iaas/model_update_network_ipv4_body.go @@ -17,12 +17,57 @@ import ( // checks if the UpdateNetworkIPv4Body type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateNetworkIPv4Body{} +/* + types and functions for gateway +*/ + +// isNullableString +type UpdateNetworkIPv4BodyGetGatewayAttributeType = *NullableString + +func getUpdateNetworkIPv4BodyGetGatewayAttributeTypeOk(arg UpdateNetworkIPv4BodyGetGatewayAttributeType) (ret UpdateNetworkIPv4BodyGetGatewayRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setUpdateNetworkIPv4BodyGetGatewayAttributeType(arg *UpdateNetworkIPv4BodyGetGatewayAttributeType, val UpdateNetworkIPv4BodyGetGatewayRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type UpdateNetworkIPv4BodyGetGatewayArgType = *string +type UpdateNetworkIPv4BodyGetGatewayRetType = *string + +/* + types and functions for nameservers +*/ + +// isArray +type UpdateNetworkIPv4BodyGetNameserversAttributeType = *[]string +type UpdateNetworkIPv4BodyGetNameserversArgType = []string +type UpdateNetworkIPv4BodyGetNameserversRetType = []string + +func getUpdateNetworkIPv4BodyGetNameserversAttributeTypeOk(arg UpdateNetworkIPv4BodyGetNameserversAttributeType) (ret UpdateNetworkIPv4BodyGetNameserversRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateNetworkIPv4BodyGetNameserversAttributeType(arg *UpdateNetworkIPv4BodyGetNameserversAttributeType, val UpdateNetworkIPv4BodyGetNameserversRetType) { + *arg = &val +} + // UpdateNetworkIPv4Body The config object for a IPv4 network update. type UpdateNetworkIPv4Body struct { // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. - Gateway *NullableString `json:"gateway,omitempty"` + Gateway UpdateNetworkIPv4BodyGetGatewayAttributeType `json:"gateway,omitempty"` // A list containing DNS Servers/Nameservers for IPv4. - Nameservers *[]string `json:"nameservers,omitempty"` + Nameservers UpdateNetworkIPv4BodyGetNameserversAttributeType `json:"nameservers,omitempty"` } // NewUpdateNetworkIPv4Body instantiates a new UpdateNetworkIPv4Body object @@ -43,96 +88,69 @@ func NewUpdateNetworkIPv4BodyWithDefaults() *UpdateNetworkIPv4Body { } // GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateNetworkIPv4Body) GetGateway() *string { - if o == nil || IsNil(o.Gateway) || IsNil(o.Gateway.Get()) { - var ret *string - return ret - } - return o.Gateway.Get() +func (o *UpdateNetworkIPv4Body) GetGateway() (res UpdateNetworkIPv4BodyGetGatewayRetType) { + res, _ = o.GetGatewayOk() + return } // GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdateNetworkIPv4Body) GetGatewayOk() (*string, bool) { - if o == nil || IsNil(o.Gateway) { - return nil, false - } - return o.Gateway.Get(), o.Gateway.IsSet() +func (o *UpdateNetworkIPv4Body) GetGatewayOk() (ret UpdateNetworkIPv4BodyGetGatewayRetType, ok bool) { + return getUpdateNetworkIPv4BodyGetGatewayAttributeTypeOk(o.Gateway) } // HasGateway returns a boolean if a field has been set. func (o *UpdateNetworkIPv4Body) HasGateway() bool { - if o != nil && !IsNil(o.Gateway) && o.Gateway.IsSet() { - return true - } - - return false + _, ok := o.GetGatewayOk() + return ok } // SetGateway gets a reference to the given string and assigns it to the Gateway field. -func (o *UpdateNetworkIPv4Body) SetGateway(v *string) { - if IsNil(o.Gateway) { - o.Gateway = new(NullableString) - } - o.Gateway.Set(v) +func (o *UpdateNetworkIPv4Body) SetGateway(v UpdateNetworkIPv4BodyGetGatewayRetType) { + setUpdateNetworkIPv4BodyGetGatewayAttributeType(&o.Gateway, v) } // SetGatewayNil sets the value for Gateway to be an explicit nil func (o *UpdateNetworkIPv4Body) SetGatewayNil() { - if IsNil(o.Gateway) { - o.Gateway = new(NullableString) - } - o.Gateway.Set(nil) + o.Gateway = nil } // UnsetGateway ensures that no value is present for Gateway, not even an explicit nil func (o *UpdateNetworkIPv4Body) UnsetGateway() { - if IsNil(o.Gateway) { - o.Gateway = new(NullableString) - } - o.Gateway.Unset() + o.Gateway = nil } // GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *UpdateNetworkIPv4Body) GetNameservers() *[]string { - if o == nil || IsNil(o.Nameservers) { - var ret *[]string - return ret - } - return o.Nameservers +func (o *UpdateNetworkIPv4Body) GetNameservers() (res UpdateNetworkIPv4BodyGetNameserversRetType) { + res, _ = o.GetNameserversOk() + return } // GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateNetworkIPv4Body) GetNameserversOk() (*[]string, bool) { - if o == nil || IsNil(o.Nameservers) { - return nil, false - } - return o.Nameservers, true +func (o *UpdateNetworkIPv4Body) GetNameserversOk() (ret UpdateNetworkIPv4BodyGetNameserversRetType, ok bool) { + return getUpdateNetworkIPv4BodyGetNameserversAttributeTypeOk(o.Nameservers) } // HasNameservers returns a boolean if a field has been set. func (o *UpdateNetworkIPv4Body) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { - return true - } - - return false + _, ok := o.GetNameserversOk() + return ok } // SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *UpdateNetworkIPv4Body) SetNameservers(v *[]string) { - o.Nameservers = v +func (o *UpdateNetworkIPv4Body) SetNameservers(v UpdateNetworkIPv4BodyGetNameserversRetType) { + setUpdateNetworkIPv4BodyGetNameserversAttributeType(&o.Nameservers, v) } func (o UpdateNetworkIPv4Body) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Gateway.IsSet() { - toSerialize["gateway"] = o.Gateway.Get() + if val, ok := getUpdateNetworkIPv4BodyGetGatewayAttributeTypeOk(o.Gateway); ok { + toSerialize["Gateway"] = val } - if !IsNil(o.Nameservers) { - toSerialize["nameservers"] = o.Nameservers + if val, ok := getUpdateNetworkIPv4BodyGetNameserversAttributeTypeOk(o.Nameservers); ok { + toSerialize["Nameservers"] = val } return toSerialize, nil } diff --git a/services/iaas/model_update_network_ipv6_body.go b/services/iaas/model_update_network_ipv6_body.go index 7fd66ef6f..8cd31adc5 100644 --- a/services/iaas/model_update_network_ipv6_body.go +++ b/services/iaas/model_update_network_ipv6_body.go @@ -17,12 +17,57 @@ import ( // checks if the UpdateNetworkIPv6Body type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateNetworkIPv6Body{} +/* + types and functions for gateway +*/ + +// isNullableString +type UpdateNetworkIPv6BodyGetGatewayAttributeType = *NullableString + +func getUpdateNetworkIPv6BodyGetGatewayAttributeTypeOk(arg UpdateNetworkIPv6BodyGetGatewayAttributeType) (ret UpdateNetworkIPv6BodyGetGatewayRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setUpdateNetworkIPv6BodyGetGatewayAttributeType(arg *UpdateNetworkIPv6BodyGetGatewayAttributeType, val UpdateNetworkIPv6BodyGetGatewayRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type UpdateNetworkIPv6BodyGetGatewayArgType = *string +type UpdateNetworkIPv6BodyGetGatewayRetType = *string + +/* + types and functions for nameservers +*/ + +// isArray +type UpdateNetworkIPv6BodyGetNameserversAttributeType = *[]string +type UpdateNetworkIPv6BodyGetNameserversArgType = []string +type UpdateNetworkIPv6BodyGetNameserversRetType = []string + +func getUpdateNetworkIPv6BodyGetNameserversAttributeTypeOk(arg UpdateNetworkIPv6BodyGetNameserversAttributeType) (ret UpdateNetworkIPv6BodyGetNameserversRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateNetworkIPv6BodyGetNameserversAttributeType(arg *UpdateNetworkIPv6BodyGetNameserversAttributeType, val UpdateNetworkIPv6BodyGetNameserversRetType) { + *arg = &val +} + // UpdateNetworkIPv6Body The config object for a IPv6 network update. type UpdateNetworkIPv6Body struct { // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. - Gateway *NullableString `json:"gateway,omitempty"` + Gateway UpdateNetworkIPv6BodyGetGatewayAttributeType `json:"gateway,omitempty"` // A list containing DNS Servers/Nameservers for IPv6. - Nameservers *[]string `json:"nameservers,omitempty"` + Nameservers UpdateNetworkIPv6BodyGetNameserversAttributeType `json:"nameservers,omitempty"` } // NewUpdateNetworkIPv6Body instantiates a new UpdateNetworkIPv6Body object @@ -43,96 +88,69 @@ func NewUpdateNetworkIPv6BodyWithDefaults() *UpdateNetworkIPv6Body { } // GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdateNetworkIPv6Body) GetGateway() *string { - if o == nil || IsNil(o.Gateway) || IsNil(o.Gateway.Get()) { - var ret *string - return ret - } - return o.Gateway.Get() +func (o *UpdateNetworkIPv6Body) GetGateway() (res UpdateNetworkIPv6BodyGetGatewayRetType) { + res, _ = o.GetGatewayOk() + return } // GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdateNetworkIPv6Body) GetGatewayOk() (*string, bool) { - if o == nil || IsNil(o.Gateway) { - return nil, false - } - return o.Gateway.Get(), o.Gateway.IsSet() +func (o *UpdateNetworkIPv6Body) GetGatewayOk() (ret UpdateNetworkIPv6BodyGetGatewayRetType, ok bool) { + return getUpdateNetworkIPv6BodyGetGatewayAttributeTypeOk(o.Gateway) } // HasGateway returns a boolean if a field has been set. func (o *UpdateNetworkIPv6Body) HasGateway() bool { - if o != nil && !IsNil(o.Gateway) && o.Gateway.IsSet() { - return true - } - - return false + _, ok := o.GetGatewayOk() + return ok } // SetGateway gets a reference to the given string and assigns it to the Gateway field. -func (o *UpdateNetworkIPv6Body) SetGateway(v *string) { - if IsNil(o.Gateway) { - o.Gateway = new(NullableString) - } - o.Gateway.Set(v) +func (o *UpdateNetworkIPv6Body) SetGateway(v UpdateNetworkIPv6BodyGetGatewayRetType) { + setUpdateNetworkIPv6BodyGetGatewayAttributeType(&o.Gateway, v) } // SetGatewayNil sets the value for Gateway to be an explicit nil func (o *UpdateNetworkIPv6Body) SetGatewayNil() { - if IsNil(o.Gateway) { - o.Gateway = new(NullableString) - } - o.Gateway.Set(nil) + o.Gateway = nil } // UnsetGateway ensures that no value is present for Gateway, not even an explicit nil func (o *UpdateNetworkIPv6Body) UnsetGateway() { - if IsNil(o.Gateway) { - o.Gateway = new(NullableString) - } - o.Gateway.Unset() + o.Gateway = nil } // GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *UpdateNetworkIPv6Body) GetNameservers() *[]string { - if o == nil || IsNil(o.Nameservers) { - var ret *[]string - return ret - } - return o.Nameservers +func (o *UpdateNetworkIPv6Body) GetNameservers() (res UpdateNetworkIPv6BodyGetNameserversRetType) { + res, _ = o.GetNameserversOk() + return } // GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateNetworkIPv6Body) GetNameserversOk() (*[]string, bool) { - if o == nil || IsNil(o.Nameservers) { - return nil, false - } - return o.Nameservers, true +func (o *UpdateNetworkIPv6Body) GetNameserversOk() (ret UpdateNetworkIPv6BodyGetNameserversRetType, ok bool) { + return getUpdateNetworkIPv6BodyGetNameserversAttributeTypeOk(o.Nameservers) } // HasNameservers returns a boolean if a field has been set. func (o *UpdateNetworkIPv6Body) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { - return true - } - - return false + _, ok := o.GetNameserversOk() + return ok } // SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *UpdateNetworkIPv6Body) SetNameservers(v *[]string) { - o.Nameservers = v +func (o *UpdateNetworkIPv6Body) SetNameservers(v UpdateNetworkIPv6BodyGetNameserversRetType) { + setUpdateNetworkIPv6BodyGetNameserversAttributeType(&o.Nameservers, v) } func (o UpdateNetworkIPv6Body) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Gateway.IsSet() { - toSerialize["gateway"] = o.Gateway.Get() + if val, ok := getUpdateNetworkIPv6BodyGetGatewayAttributeTypeOk(o.Gateway); ok { + toSerialize["Gateway"] = val } - if !IsNil(o.Nameservers) { - toSerialize["nameservers"] = o.Nameservers + if val, ok := getUpdateNetworkIPv6BodyGetNameserversAttributeTypeOk(o.Nameservers); ok { + toSerialize["Nameservers"] = val } return toSerialize, nil } diff --git a/services/iaas/model_update_nic_payload.go b/services/iaas/model_update_nic_payload.go index 103b72a62..0964b9201 100644 --- a/services/iaas/model_update_nic_payload.go +++ b/services/iaas/model_update_nic_payload.go @@ -17,18 +17,119 @@ import ( // checks if the UpdateNicPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateNicPayload{} +/* + types and functions for allowedAddresses +*/ + +// isArray +type UpdateNicPayloadGetAllowedAddressesAttributeType = *[]AllowedAddressesInner +type UpdateNicPayloadGetAllowedAddressesArgType = []AllowedAddressesInner +type UpdateNicPayloadGetAllowedAddressesRetType = []AllowedAddressesInner + +func getUpdateNicPayloadGetAllowedAddressesAttributeTypeOk(arg UpdateNicPayloadGetAllowedAddressesAttributeType) (ret UpdateNicPayloadGetAllowedAddressesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateNicPayloadGetAllowedAddressesAttributeType(arg *UpdateNicPayloadGetAllowedAddressesAttributeType, val UpdateNicPayloadGetAllowedAddressesRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isFreeform +type UpdateNicPayloadGetLabelsAttributeType = *map[string]interface{} +type UpdateNicPayloadGetLabelsArgType = map[string]interface{} +type UpdateNicPayloadGetLabelsRetType = map[string]interface{} + +func getUpdateNicPayloadGetLabelsAttributeTypeOk(arg UpdateNicPayloadGetLabelsAttributeType) (ret UpdateNicPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateNicPayloadGetLabelsAttributeType(arg *UpdateNicPayloadGetLabelsAttributeType, val UpdateNicPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type UpdateNicPayloadGetNameAttributeType = *string + +func getUpdateNicPayloadGetNameAttributeTypeOk(arg UpdateNicPayloadGetNameAttributeType) (ret UpdateNicPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateNicPayloadGetNameAttributeType(arg *UpdateNicPayloadGetNameAttributeType, val UpdateNicPayloadGetNameRetType) { + *arg = &val +} + +type UpdateNicPayloadGetNameArgType = string +type UpdateNicPayloadGetNameRetType = string + +/* + types and functions for nicSecurity +*/ + +// isBoolean +type UpdateNicPayloadgetNicSecurityAttributeType = *bool +type UpdateNicPayloadgetNicSecurityArgType = bool +type UpdateNicPayloadgetNicSecurityRetType = bool + +func getUpdateNicPayloadgetNicSecurityAttributeTypeOk(arg UpdateNicPayloadgetNicSecurityAttributeType) (ret UpdateNicPayloadgetNicSecurityRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateNicPayloadgetNicSecurityAttributeType(arg *UpdateNicPayloadgetNicSecurityAttributeType, val UpdateNicPayloadgetNicSecurityRetType) { + *arg = &val +} + +/* + types and functions for securityGroups +*/ + +// isArray +type UpdateNicPayloadGetSecurityGroupsAttributeType = *[]string +type UpdateNicPayloadGetSecurityGroupsArgType = []string +type UpdateNicPayloadGetSecurityGroupsRetType = []string + +func getUpdateNicPayloadGetSecurityGroupsAttributeTypeOk(arg UpdateNicPayloadGetSecurityGroupsAttributeType) (ret UpdateNicPayloadGetSecurityGroupsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateNicPayloadGetSecurityGroupsAttributeType(arg *UpdateNicPayloadGetSecurityGroupsAttributeType, val UpdateNicPayloadGetSecurityGroupsRetType) { + *arg = &val +} + // UpdateNicPayload Object that represents a network interface update. type UpdateNicPayload struct { // A list of IPs or CIDR notations. - AllowedAddresses *[]AllowedAddressesInner `json:"allowedAddresses,omitempty"` + AllowedAddresses UpdateNicPayloadGetAllowedAddressesAttributeType `json:"allowedAddresses,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels UpdateNicPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty"` + Name UpdateNicPayloadGetNameAttributeType `json:"name,omitempty"` // If this is set to false, then no security groups will apply to this network interface. - NicSecurity *bool `json:"nicSecurity,omitempty"` + NicSecurity UpdateNicPayloadgetNicSecurityAttributeType `json:"nicSecurity,omitempty"` // A list of UUIDs. - SecurityGroups *[]string `json:"securityGroups,omitempty"` + SecurityGroups UpdateNicPayloadGetSecurityGroupsAttributeType `json:"securityGroups,omitempty"` } // NewUpdateNicPayload instantiates a new UpdateNicPayload object @@ -49,181 +150,136 @@ func NewUpdateNicPayloadWithDefaults() *UpdateNicPayload { } // GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. -func (o *UpdateNicPayload) GetAllowedAddresses() *[]AllowedAddressesInner { - if o == nil || IsNil(o.AllowedAddresses) { - var ret *[]AllowedAddressesInner - return ret - } - return o.AllowedAddresses +func (o *UpdateNicPayload) GetAllowedAddresses() (res UpdateNicPayloadGetAllowedAddressesRetType) { + res, _ = o.GetAllowedAddressesOk() + return } // GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateNicPayload) GetAllowedAddressesOk() (*[]AllowedAddressesInner, bool) { - if o == nil || IsNil(o.AllowedAddresses) { - return nil, false - } - return o.AllowedAddresses, true +func (o *UpdateNicPayload) GetAllowedAddressesOk() (ret UpdateNicPayloadGetAllowedAddressesRetType, ok bool) { + return getUpdateNicPayloadGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses) } // HasAllowedAddresses returns a boolean if a field has been set. func (o *UpdateNicPayload) HasAllowedAddresses() bool { - if o != nil && !IsNil(o.AllowedAddresses) { - return true - } - - return false + _, ok := o.GetAllowedAddressesOk() + return ok } // SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. -func (o *UpdateNicPayload) SetAllowedAddresses(v *[]AllowedAddressesInner) { - o.AllowedAddresses = v +func (o *UpdateNicPayload) SetAllowedAddresses(v UpdateNicPayloadGetAllowedAddressesRetType) { + setUpdateNicPayloadGetAllowedAddressesAttributeType(&o.AllowedAddresses, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateNicPayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *UpdateNicPayload) GetLabels() (res UpdateNicPayloadGetLabelsRetType) { + 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 *UpdateNicPayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *UpdateNicPayload) GetLabelsOk() (ret UpdateNicPayloadGetLabelsRetType, ok bool) { + return getUpdateNicPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *UpdateNicPayload) 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 *UpdateNicPayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *UpdateNicPayload) SetLabels(v UpdateNicPayloadGetLabelsRetType) { + setUpdateNicPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateNicPayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *UpdateNicPayload) GetName() (res UpdateNicPayloadGetNameRetType) { + 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 *UpdateNicPayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *UpdateNicPayload) GetNameOk() (ret UpdateNicPayloadGetNameRetType, ok bool) { + return getUpdateNicPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *UpdateNicPayload) 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 *UpdateNicPayload) SetName(v *string) { - o.Name = v +func (o *UpdateNicPayload) SetName(v UpdateNicPayloadGetNameRetType) { + setUpdateNicPayloadGetNameAttributeType(&o.Name, v) } // GetNicSecurity returns the NicSecurity field value if set, zero value otherwise. -func (o *UpdateNicPayload) GetNicSecurity() *bool { - if o == nil || IsNil(o.NicSecurity) { - var ret *bool - return ret - } - return o.NicSecurity +func (o *UpdateNicPayload) GetNicSecurity() (res UpdateNicPayloadgetNicSecurityRetType) { + res, _ = o.GetNicSecurityOk() + return } // GetNicSecurityOk returns a tuple with the NicSecurity field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateNicPayload) GetNicSecurityOk() (*bool, bool) { - if o == nil || IsNil(o.NicSecurity) { - return nil, false - } - return o.NicSecurity, true +func (o *UpdateNicPayload) GetNicSecurityOk() (ret UpdateNicPayloadgetNicSecurityRetType, ok bool) { + return getUpdateNicPayloadgetNicSecurityAttributeTypeOk(o.NicSecurity) } // HasNicSecurity returns a boolean if a field has been set. func (o *UpdateNicPayload) HasNicSecurity() bool { - if o != nil && !IsNil(o.NicSecurity) { - return true - } - - return false + _, ok := o.GetNicSecurityOk() + return ok } // SetNicSecurity gets a reference to the given bool and assigns it to the NicSecurity field. -func (o *UpdateNicPayload) SetNicSecurity(v *bool) { - o.NicSecurity = v +func (o *UpdateNicPayload) SetNicSecurity(v UpdateNicPayloadgetNicSecurityRetType) { + setUpdateNicPayloadgetNicSecurityAttributeType(&o.NicSecurity, v) } // GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. -func (o *UpdateNicPayload) GetSecurityGroups() *[]string { - if o == nil || IsNil(o.SecurityGroups) { - var ret *[]string - return ret - } - return o.SecurityGroups +func (o *UpdateNicPayload) GetSecurityGroups() (res UpdateNicPayloadGetSecurityGroupsRetType) { + res, _ = o.GetSecurityGroupsOk() + return } // GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateNicPayload) GetSecurityGroupsOk() (*[]string, bool) { - if o == nil || IsNil(o.SecurityGroups) { - return nil, false - } - return o.SecurityGroups, true +func (o *UpdateNicPayload) GetSecurityGroupsOk() (ret UpdateNicPayloadGetSecurityGroupsRetType, ok bool) { + return getUpdateNicPayloadGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) } // HasSecurityGroups returns a boolean if a field has been set. func (o *UpdateNicPayload) HasSecurityGroups() bool { - if o != nil && !IsNil(o.SecurityGroups) { - return true - } - - return false + _, ok := o.GetSecurityGroupsOk() + return ok } // SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. -func (o *UpdateNicPayload) SetSecurityGroups(v *[]string) { - o.SecurityGroups = v +func (o *UpdateNicPayload) SetSecurityGroups(v UpdateNicPayloadGetSecurityGroupsRetType) { + setUpdateNicPayloadGetSecurityGroupsAttributeType(&o.SecurityGroups, v) } func (o UpdateNicPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.AllowedAddresses) { - toSerialize["allowedAddresses"] = o.AllowedAddresses + if val, ok := getUpdateNicPayloadGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses); ok { + toSerialize["AllowedAddresses"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getUpdateNicPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getUpdateNicPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.NicSecurity) { - toSerialize["nicSecurity"] = o.NicSecurity + if val, ok := getUpdateNicPayloadgetNicSecurityAttributeTypeOk(o.NicSecurity); ok { + toSerialize["NicSecurity"] = val } - if !IsNil(o.SecurityGroups) { - toSerialize["securityGroups"] = o.SecurityGroups + if val, ok := getUpdateNicPayloadGetSecurityGroupsAttributeTypeOk(o.SecurityGroups); ok { + toSerialize["SecurityGroups"] = val } return toSerialize, nil } diff --git a/services/iaas/model_update_public_ip_payload.go b/services/iaas/model_update_public_ip_payload.go index 9ebe3c40f..ce8bda862 100644 --- a/services/iaas/model_update_public_ip_payload.go +++ b/services/iaas/model_update_public_ip_payload.go @@ -17,16 +17,103 @@ import ( // checks if the UpdatePublicIPPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdatePublicIPPayload{} +/* + types and functions for id +*/ + +// isNotNullableString +type UpdatePublicIPPayloadGetIdAttributeType = *string + +func getUpdatePublicIPPayloadGetIdAttributeTypeOk(arg UpdatePublicIPPayloadGetIdAttributeType) (ret UpdatePublicIPPayloadGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdatePublicIPPayloadGetIdAttributeType(arg *UpdatePublicIPPayloadGetIdAttributeType, val UpdatePublicIPPayloadGetIdRetType) { + *arg = &val +} + +type UpdatePublicIPPayloadGetIdArgType = string +type UpdatePublicIPPayloadGetIdRetType = string + +/* + types and functions for ip +*/ + +// isNotNullableString +type UpdatePublicIPPayloadGetIpAttributeType = *string + +func getUpdatePublicIPPayloadGetIpAttributeTypeOk(arg UpdatePublicIPPayloadGetIpAttributeType) (ret UpdatePublicIPPayloadGetIpRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdatePublicIPPayloadGetIpAttributeType(arg *UpdatePublicIPPayloadGetIpAttributeType, val UpdatePublicIPPayloadGetIpRetType) { + *arg = &val +} + +type UpdatePublicIPPayloadGetIpArgType = string +type UpdatePublicIPPayloadGetIpRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type UpdatePublicIPPayloadGetLabelsAttributeType = *map[string]interface{} +type UpdatePublicIPPayloadGetLabelsArgType = map[string]interface{} +type UpdatePublicIPPayloadGetLabelsRetType = map[string]interface{} + +func getUpdatePublicIPPayloadGetLabelsAttributeTypeOk(arg UpdatePublicIPPayloadGetLabelsAttributeType) (ret UpdatePublicIPPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdatePublicIPPayloadGetLabelsAttributeType(arg *UpdatePublicIPPayloadGetLabelsAttributeType, val UpdatePublicIPPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for networkInterface +*/ + +// isNullableString +type UpdatePublicIPPayloadGetNetworkInterfaceAttributeType = *NullableString + +func getUpdatePublicIPPayloadGetNetworkInterfaceAttributeTypeOk(arg UpdatePublicIPPayloadGetNetworkInterfaceAttributeType) (ret UpdatePublicIPPayloadGetNetworkInterfaceRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg.Get(), true +} + +func setUpdatePublicIPPayloadGetNetworkInterfaceAttributeType(arg *UpdatePublicIPPayloadGetNetworkInterfaceAttributeType, val UpdatePublicIPPayloadGetNetworkInterfaceRetType) { + if IsNil(*arg) { + *arg = NewNullableString(val) + } else { + (*arg).Set(val) + } +} + +type UpdatePublicIPPayloadGetNetworkInterfaceArgType = *string +type UpdatePublicIPPayloadGetNetworkInterfaceRetType = *string + // UpdatePublicIPPayload Object that represents a public IP. type UpdatePublicIPPayload struct { // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` + Id UpdatePublicIPPayloadGetIdAttributeType `json:"id,omitempty"` // Object that represents an IP address. - Ip *string `json:"ip,omitempty"` + Ip UpdatePublicIPPayloadGetIpAttributeType `json:"ip,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels UpdatePublicIPPayloadGetLabelsAttributeType `json:"labels,omitempty"` // Universally Unique Identifier (UUID). - NetworkInterface *NullableString `json:"networkInterface,omitempty"` + NetworkInterface UpdatePublicIPPayloadGetNetworkInterfaceAttributeType `json:"networkInterface,omitempty"` } // NewUpdatePublicIPPayload instantiates a new UpdatePublicIPPayload object @@ -47,166 +134,121 @@ func NewUpdatePublicIPPayloadWithDefaults() *UpdatePublicIPPayload { } // GetId returns the Id field value if set, zero value otherwise. -func (o *UpdatePublicIPPayload) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *UpdatePublicIPPayload) GetId() (res UpdatePublicIPPayloadGetIdRetType) { + 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 *UpdatePublicIPPayload) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *UpdatePublicIPPayload) GetIdOk() (ret UpdatePublicIPPayloadGetIdRetType, ok bool) { + return getUpdatePublicIPPayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *UpdatePublicIPPayload) 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 *UpdatePublicIPPayload) SetId(v *string) { - o.Id = v +func (o *UpdatePublicIPPayload) SetId(v UpdatePublicIPPayloadGetIdRetType) { + setUpdatePublicIPPayloadGetIdAttributeType(&o.Id, v) } // GetIp returns the Ip field value if set, zero value otherwise. -func (o *UpdatePublicIPPayload) GetIp() *string { - if o == nil || IsNil(o.Ip) { - var ret *string - return ret - } - return o.Ip +func (o *UpdatePublicIPPayload) GetIp() (res UpdatePublicIPPayloadGetIpRetType) { + res, _ = o.GetIpOk() + return } // GetIpOk returns a tuple with the Ip field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdatePublicIPPayload) GetIpOk() (*string, bool) { - if o == nil || IsNil(o.Ip) { - return nil, false - } - return o.Ip, true +func (o *UpdatePublicIPPayload) GetIpOk() (ret UpdatePublicIPPayloadGetIpRetType, ok bool) { + return getUpdatePublicIPPayloadGetIpAttributeTypeOk(o.Ip) } // HasIp returns a boolean if a field has been set. func (o *UpdatePublicIPPayload) HasIp() bool { - if o != nil && !IsNil(o.Ip) { - return true - } - - return false + _, ok := o.GetIpOk() + return ok } // SetIp gets a reference to the given string and assigns it to the Ip field. -func (o *UpdatePublicIPPayload) SetIp(v *string) { - o.Ip = v +func (o *UpdatePublicIPPayload) SetIp(v UpdatePublicIPPayloadGetIpRetType) { + setUpdatePublicIPPayloadGetIpAttributeType(&o.Ip, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdatePublicIPPayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *UpdatePublicIPPayload) GetLabels() (res UpdatePublicIPPayloadGetLabelsRetType) { + 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 *UpdatePublicIPPayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *UpdatePublicIPPayload) GetLabelsOk() (ret UpdatePublicIPPayloadGetLabelsRetType, ok bool) { + return getUpdatePublicIPPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *UpdatePublicIPPayload) 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 *UpdatePublicIPPayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *UpdatePublicIPPayload) SetLabels(v UpdatePublicIPPayloadGetLabelsRetType) { + setUpdatePublicIPPayloadGetLabelsAttributeType(&o.Labels, v) } // GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UpdatePublicIPPayload) GetNetworkInterface() *string { - if o == nil || IsNil(o.NetworkInterface) || IsNil(o.NetworkInterface.Get()) { - var ret *string - return ret - } - return o.NetworkInterface.Get() +func (o *UpdatePublicIPPayload) GetNetworkInterface() (res UpdatePublicIPPayloadGetNetworkInterfaceRetType) { + res, _ = o.GetNetworkInterfaceOk() + return } // GetNetworkInterfaceOk returns a tuple with the NetworkInterface field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UpdatePublicIPPayload) GetNetworkInterfaceOk() (*string, bool) { - if o == nil || IsNil(o.NetworkInterface) { - return nil, false - } - return o.NetworkInterface.Get(), o.NetworkInterface.IsSet() +func (o *UpdatePublicIPPayload) GetNetworkInterfaceOk() (ret UpdatePublicIPPayloadGetNetworkInterfaceRetType, ok bool) { + return getUpdatePublicIPPayloadGetNetworkInterfaceAttributeTypeOk(o.NetworkInterface) } // HasNetworkInterface returns a boolean if a field has been set. func (o *UpdatePublicIPPayload) HasNetworkInterface() bool { - if o != nil && !IsNil(o.NetworkInterface) && o.NetworkInterface.IsSet() { - return true - } - - return false + _, ok := o.GetNetworkInterfaceOk() + return ok } // SetNetworkInterface gets a reference to the given string and assigns it to the NetworkInterface field. -func (o *UpdatePublicIPPayload) SetNetworkInterface(v *string) { - if IsNil(o.NetworkInterface) { - o.NetworkInterface = new(NullableString) - } - o.NetworkInterface.Set(v) +func (o *UpdatePublicIPPayload) SetNetworkInterface(v UpdatePublicIPPayloadGetNetworkInterfaceRetType) { + setUpdatePublicIPPayloadGetNetworkInterfaceAttributeType(&o.NetworkInterface, v) } // SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil func (o *UpdatePublicIPPayload) SetNetworkInterfaceNil() { - if IsNil(o.NetworkInterface) { - o.NetworkInterface = new(NullableString) - } - o.NetworkInterface.Set(nil) + o.NetworkInterface = nil } // UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil func (o *UpdatePublicIPPayload) UnsetNetworkInterface() { - if IsNil(o.NetworkInterface) { - o.NetworkInterface = new(NullableString) - } - o.NetworkInterface.Unset() + o.NetworkInterface = nil } func (o UpdatePublicIPPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getUpdatePublicIPPayloadGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Ip) { - toSerialize["ip"] = o.Ip + if val, ok := getUpdatePublicIPPayloadGetIpAttributeTypeOk(o.Ip); ok { + toSerialize["Ip"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getUpdatePublicIPPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if o.NetworkInterface.IsSet() { - toSerialize["networkInterface"] = o.NetworkInterface.Get() + if val, ok := getUpdatePublicIPPayloadGetNetworkInterfaceAttributeTypeOk(o.NetworkInterface); ok { + toSerialize["NetworkInterface"] = val } return toSerialize, nil } diff --git a/services/iaas/model_update_security_group_payload.go b/services/iaas/model_update_security_group_payload.go index 5c227458e..5d5266e56 100644 --- a/services/iaas/model_update_security_group_payload.go +++ b/services/iaas/model_update_security_group_payload.go @@ -17,14 +17,76 @@ import ( // checks if the UpdateSecurityGroupPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateSecurityGroupPayload{} +/* + types and functions for description +*/ + +// isNotNullableString +type UpdateSecurityGroupPayloadGetDescriptionAttributeType = *string + +func getUpdateSecurityGroupPayloadGetDescriptionAttributeTypeOk(arg UpdateSecurityGroupPayloadGetDescriptionAttributeType) (ret UpdateSecurityGroupPayloadGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateSecurityGroupPayloadGetDescriptionAttributeType(arg *UpdateSecurityGroupPayloadGetDescriptionAttributeType, val UpdateSecurityGroupPayloadGetDescriptionRetType) { + *arg = &val +} + +type UpdateSecurityGroupPayloadGetDescriptionArgType = string +type UpdateSecurityGroupPayloadGetDescriptionRetType = string + +/* + types and functions for labels +*/ + +// isFreeform +type UpdateSecurityGroupPayloadGetLabelsAttributeType = *map[string]interface{} +type UpdateSecurityGroupPayloadGetLabelsArgType = map[string]interface{} +type UpdateSecurityGroupPayloadGetLabelsRetType = map[string]interface{} + +func getUpdateSecurityGroupPayloadGetLabelsAttributeTypeOk(arg UpdateSecurityGroupPayloadGetLabelsAttributeType) (ret UpdateSecurityGroupPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateSecurityGroupPayloadGetLabelsAttributeType(arg *UpdateSecurityGroupPayloadGetLabelsAttributeType, val UpdateSecurityGroupPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type UpdateSecurityGroupPayloadGetNameAttributeType = *string + +func getUpdateSecurityGroupPayloadGetNameAttributeTypeOk(arg UpdateSecurityGroupPayloadGetNameAttributeType) (ret UpdateSecurityGroupPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateSecurityGroupPayloadGetNameAttributeType(arg *UpdateSecurityGroupPayloadGetNameAttributeType, val UpdateSecurityGroupPayloadGetNameRetType) { + *arg = &val +} + +type UpdateSecurityGroupPayloadGetNameArgType = string +type UpdateSecurityGroupPayloadGetNameRetType = string + // UpdateSecurityGroupPayload Object that represents an update request body of a security group. type UpdateSecurityGroupPayload struct { // Description Object. Allows string up to 127 Characters. - Description *string `json:"description,omitempty"` + Description UpdateSecurityGroupPayloadGetDescriptionAttributeType `json:"description,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels UpdateSecurityGroupPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty"` + Name UpdateSecurityGroupPayloadGetNameAttributeType `json:"name,omitempty"` } // NewUpdateSecurityGroupPayload instantiates a new UpdateSecurityGroupPayload object @@ -45,111 +107,84 @@ func NewUpdateSecurityGroupPayloadWithDefaults() *UpdateSecurityGroupPayload { } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *UpdateSecurityGroupPayload) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *UpdateSecurityGroupPayload) GetDescription() (res UpdateSecurityGroupPayloadGetDescriptionRetType) { + 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 *UpdateSecurityGroupPayload) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *UpdateSecurityGroupPayload) GetDescriptionOk() (ret UpdateSecurityGroupPayloadGetDescriptionRetType, ok bool) { + return getUpdateSecurityGroupPayloadGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *UpdateSecurityGroupPayload) 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 *UpdateSecurityGroupPayload) SetDescription(v *string) { - o.Description = v +func (o *UpdateSecurityGroupPayload) SetDescription(v UpdateSecurityGroupPayloadGetDescriptionRetType) { + setUpdateSecurityGroupPayloadGetDescriptionAttributeType(&o.Description, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateSecurityGroupPayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *UpdateSecurityGroupPayload) GetLabels() (res UpdateSecurityGroupPayloadGetLabelsRetType) { + 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 *UpdateSecurityGroupPayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *UpdateSecurityGroupPayload) GetLabelsOk() (ret UpdateSecurityGroupPayloadGetLabelsRetType, ok bool) { + return getUpdateSecurityGroupPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *UpdateSecurityGroupPayload) 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 *UpdateSecurityGroupPayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *UpdateSecurityGroupPayload) SetLabels(v UpdateSecurityGroupPayloadGetLabelsRetType) { + setUpdateSecurityGroupPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateSecurityGroupPayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *UpdateSecurityGroupPayload) GetName() (res UpdateSecurityGroupPayloadGetNameRetType) { + 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 *UpdateSecurityGroupPayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *UpdateSecurityGroupPayload) GetNameOk() (ret UpdateSecurityGroupPayloadGetNameRetType, ok bool) { + return getUpdateSecurityGroupPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *UpdateSecurityGroupPayload) 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 *UpdateSecurityGroupPayload) SetName(v *string) { - o.Name = v +func (o *UpdateSecurityGroupPayload) SetName(v UpdateSecurityGroupPayloadGetNameRetType) { + setUpdateSecurityGroupPayloadGetNameAttributeType(&o.Name, v) } func (o UpdateSecurityGroupPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getUpdateSecurityGroupPayloadGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getUpdateSecurityGroupPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getUpdateSecurityGroupPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } return toSerialize, nil } diff --git a/services/iaas/model_update_server_payload.go b/services/iaas/model_update_server_payload.go index 0ebb041b5..e110c3e80 100644 --- a/services/iaas/model_update_server_payload.go +++ b/services/iaas/model_update_server_payload.go @@ -17,12 +17,53 @@ import ( // checks if the UpdateServerPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateServerPayload{} +/* + types and functions for labels +*/ + +// isFreeform +type UpdateServerPayloadGetLabelsAttributeType = *map[string]interface{} +type UpdateServerPayloadGetLabelsArgType = map[string]interface{} +type UpdateServerPayloadGetLabelsRetType = map[string]interface{} + +func getUpdateServerPayloadGetLabelsAttributeTypeOk(arg UpdateServerPayloadGetLabelsAttributeType) (ret UpdateServerPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateServerPayloadGetLabelsAttributeType(arg *UpdateServerPayloadGetLabelsAttributeType, val UpdateServerPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type UpdateServerPayloadGetNameAttributeType = *string + +func getUpdateServerPayloadGetNameAttributeTypeOk(arg UpdateServerPayloadGetNameAttributeType) (ret UpdateServerPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateServerPayloadGetNameAttributeType(arg *UpdateServerPayloadGetNameAttributeType, val UpdateServerPayloadGetNameRetType) { + *arg = &val +} + +type UpdateServerPayloadGetNameArgType = string +type UpdateServerPayloadGetNameRetType = string + // UpdateServerPayload Object that represents an update request body of a server. type UpdateServerPayload struct { // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels UpdateServerPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a Server. - Name *string `json:"name,omitempty"` + Name UpdateServerPayloadGetNameAttributeType `json:"name,omitempty"` } // NewUpdateServerPayload instantiates a new UpdateServerPayload object @@ -43,76 +84,58 @@ func NewUpdateServerPayloadWithDefaults() *UpdateServerPayload { } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateServerPayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *UpdateServerPayload) GetLabels() (res UpdateServerPayloadGetLabelsRetType) { + 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 *UpdateServerPayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *UpdateServerPayload) GetLabelsOk() (ret UpdateServerPayloadGetLabelsRetType, ok bool) { + return getUpdateServerPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *UpdateServerPayload) 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 *UpdateServerPayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *UpdateServerPayload) SetLabels(v UpdateServerPayloadGetLabelsRetType) { + setUpdateServerPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateServerPayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *UpdateServerPayload) GetName() (res UpdateServerPayloadGetNameRetType) { + 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 *UpdateServerPayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *UpdateServerPayload) GetNameOk() (ret UpdateServerPayloadGetNameRetType, ok bool) { + return getUpdateServerPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *UpdateServerPayload) 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 *UpdateServerPayload) SetName(v *string) { - o.Name = v +func (o *UpdateServerPayload) SetName(v UpdateServerPayloadGetNameRetType) { + setUpdateServerPayloadGetNameAttributeType(&o.Name, v) } func (o UpdateServerPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getUpdateServerPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getUpdateServerPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } return toSerialize, nil } diff --git a/services/iaas/model_update_snapshot_payload.go b/services/iaas/model_update_snapshot_payload.go index 71e46f850..b370f6ccb 100644 --- a/services/iaas/model_update_snapshot_payload.go +++ b/services/iaas/model_update_snapshot_payload.go @@ -17,12 +17,53 @@ import ( // checks if the UpdateSnapshotPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateSnapshotPayload{} +/* + types and functions for labels +*/ + +// isFreeform +type UpdateSnapshotPayloadGetLabelsAttributeType = *map[string]interface{} +type UpdateSnapshotPayloadGetLabelsArgType = map[string]interface{} +type UpdateSnapshotPayloadGetLabelsRetType = map[string]interface{} + +func getUpdateSnapshotPayloadGetLabelsAttributeTypeOk(arg UpdateSnapshotPayloadGetLabelsAttributeType) (ret UpdateSnapshotPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateSnapshotPayloadGetLabelsAttributeType(arg *UpdateSnapshotPayloadGetLabelsAttributeType, val UpdateSnapshotPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type UpdateSnapshotPayloadGetNameAttributeType = *string + +func getUpdateSnapshotPayloadGetNameAttributeTypeOk(arg UpdateSnapshotPayloadGetNameAttributeType) (ret UpdateSnapshotPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateSnapshotPayloadGetNameAttributeType(arg *UpdateSnapshotPayloadGetNameAttributeType, val UpdateSnapshotPayloadGetNameRetType) { + *arg = &val +} + +type UpdateSnapshotPayloadGetNameArgType = string +type UpdateSnapshotPayloadGetNameRetType = string + // UpdateSnapshotPayload Object that represents an update request body of a snapshot. type UpdateSnapshotPayload struct { // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels UpdateSnapshotPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty"` + Name UpdateSnapshotPayloadGetNameAttributeType `json:"name,omitempty"` } // NewUpdateSnapshotPayload instantiates a new UpdateSnapshotPayload object @@ -43,76 +84,58 @@ func NewUpdateSnapshotPayloadWithDefaults() *UpdateSnapshotPayload { } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateSnapshotPayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *UpdateSnapshotPayload) GetLabels() (res UpdateSnapshotPayloadGetLabelsRetType) { + 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 *UpdateSnapshotPayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *UpdateSnapshotPayload) GetLabelsOk() (ret UpdateSnapshotPayloadGetLabelsRetType, ok bool) { + return getUpdateSnapshotPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *UpdateSnapshotPayload) 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 *UpdateSnapshotPayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *UpdateSnapshotPayload) SetLabels(v UpdateSnapshotPayloadGetLabelsRetType) { + setUpdateSnapshotPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateSnapshotPayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *UpdateSnapshotPayload) GetName() (res UpdateSnapshotPayloadGetNameRetType) { + 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 *UpdateSnapshotPayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *UpdateSnapshotPayload) GetNameOk() (ret UpdateSnapshotPayloadGetNameRetType, ok bool) { + return getUpdateSnapshotPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *UpdateSnapshotPayload) 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 *UpdateSnapshotPayload) SetName(v *string) { - o.Name = v +func (o *UpdateSnapshotPayload) SetName(v UpdateSnapshotPayloadGetNameRetType) { + setUpdateSnapshotPayloadGetNameAttributeType(&o.Name, v) } func (o UpdateSnapshotPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getUpdateSnapshotPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getUpdateSnapshotPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } return toSerialize, nil } diff --git a/services/iaas/model_update_volume_payload.go b/services/iaas/model_update_volume_payload.go index 4da4cb547..c26af8b0c 100644 --- a/services/iaas/model_update_volume_payload.go +++ b/services/iaas/model_update_volume_payload.go @@ -17,17 +17,119 @@ import ( // checks if the UpdateVolumePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateVolumePayload{} +/* + types and functions for bootable +*/ + +// isBoolean +type UpdateVolumePayloadgetBootableAttributeType = *bool +type UpdateVolumePayloadgetBootableArgType = bool +type UpdateVolumePayloadgetBootableRetType = bool + +func getUpdateVolumePayloadgetBootableAttributeTypeOk(arg UpdateVolumePayloadgetBootableAttributeType) (ret UpdateVolumePayloadgetBootableRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateVolumePayloadgetBootableAttributeType(arg *UpdateVolumePayloadgetBootableAttributeType, val UpdateVolumePayloadgetBootableRetType) { + *arg = &val +} + +/* + types and functions for description +*/ + +// isNotNullableString +type UpdateVolumePayloadGetDescriptionAttributeType = *string + +func getUpdateVolumePayloadGetDescriptionAttributeTypeOk(arg UpdateVolumePayloadGetDescriptionAttributeType) (ret UpdateVolumePayloadGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateVolumePayloadGetDescriptionAttributeType(arg *UpdateVolumePayloadGetDescriptionAttributeType, val UpdateVolumePayloadGetDescriptionRetType) { + *arg = &val +} + +type UpdateVolumePayloadGetDescriptionArgType = string +type UpdateVolumePayloadGetDescriptionRetType = string + +/* + types and functions for imageConfig +*/ + +// isModel +type UpdateVolumePayloadGetImageConfigAttributeType = *ImageConfig +type UpdateVolumePayloadGetImageConfigArgType = ImageConfig +type UpdateVolumePayloadGetImageConfigRetType = ImageConfig + +func getUpdateVolumePayloadGetImageConfigAttributeTypeOk(arg UpdateVolumePayloadGetImageConfigAttributeType) (ret UpdateVolumePayloadGetImageConfigRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateVolumePayloadGetImageConfigAttributeType(arg *UpdateVolumePayloadGetImageConfigAttributeType, val UpdateVolumePayloadGetImageConfigRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isFreeform +type UpdateVolumePayloadGetLabelsAttributeType = *map[string]interface{} +type UpdateVolumePayloadGetLabelsArgType = map[string]interface{} +type UpdateVolumePayloadGetLabelsRetType = map[string]interface{} + +func getUpdateVolumePayloadGetLabelsAttributeTypeOk(arg UpdateVolumePayloadGetLabelsAttributeType) (ret UpdateVolumePayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateVolumePayloadGetLabelsAttributeType(arg *UpdateVolumePayloadGetLabelsAttributeType, val UpdateVolumePayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type UpdateVolumePayloadGetNameAttributeType = *string + +func getUpdateVolumePayloadGetNameAttributeTypeOk(arg UpdateVolumePayloadGetNameAttributeType) (ret UpdateVolumePayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateVolumePayloadGetNameAttributeType(arg *UpdateVolumePayloadGetNameAttributeType, val UpdateVolumePayloadGetNameRetType) { + *arg = &val +} + +type UpdateVolumePayloadGetNameArgType = string +type UpdateVolumePayloadGetNameRetType = string + // UpdateVolumePayload Object that represents an update request body of a volume. type UpdateVolumePayload struct { // Indicates if a volume is bootable. - Bootable *bool `json:"bootable,omitempty"` + Bootable UpdateVolumePayloadgetBootableAttributeType `json:"bootable,omitempty"` // Description Object. Allows string up to 127 Characters. - Description *string `json:"description,omitempty"` - ImageConfig *ImageConfig `json:"imageConfig,omitempty"` + Description UpdateVolumePayloadGetDescriptionAttributeType `json:"description,omitempty"` + ImageConfig UpdateVolumePayloadGetImageConfigAttributeType `json:"imageConfig,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels UpdateVolumePayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty"` + Name UpdateVolumePayloadGetNameAttributeType `json:"name,omitempty"` } // NewUpdateVolumePayload instantiates a new UpdateVolumePayload object @@ -48,181 +150,136 @@ func NewUpdateVolumePayloadWithDefaults() *UpdateVolumePayload { } // GetBootable returns the Bootable field value if set, zero value otherwise. -func (o *UpdateVolumePayload) GetBootable() *bool { - if o == nil || IsNil(o.Bootable) { - var ret *bool - return ret - } - return o.Bootable +func (o *UpdateVolumePayload) GetBootable() (res UpdateVolumePayloadgetBootableRetType) { + res, _ = o.GetBootableOk() + return } // GetBootableOk returns a tuple with the Bootable field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateVolumePayload) GetBootableOk() (*bool, bool) { - if o == nil || IsNil(o.Bootable) { - return nil, false - } - return o.Bootable, true +func (o *UpdateVolumePayload) GetBootableOk() (ret UpdateVolumePayloadgetBootableRetType, ok bool) { + return getUpdateVolumePayloadgetBootableAttributeTypeOk(o.Bootable) } // HasBootable returns a boolean if a field has been set. func (o *UpdateVolumePayload) HasBootable() bool { - if o != nil && !IsNil(o.Bootable) { - return true - } - - return false + _, ok := o.GetBootableOk() + return ok } // SetBootable gets a reference to the given bool and assigns it to the Bootable field. -func (o *UpdateVolumePayload) SetBootable(v *bool) { - o.Bootable = v +func (o *UpdateVolumePayload) SetBootable(v UpdateVolumePayloadgetBootableRetType) { + setUpdateVolumePayloadgetBootableAttributeType(&o.Bootable, v) } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *UpdateVolumePayload) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *UpdateVolumePayload) GetDescription() (res UpdateVolumePayloadGetDescriptionRetType) { + 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 *UpdateVolumePayload) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *UpdateVolumePayload) GetDescriptionOk() (ret UpdateVolumePayloadGetDescriptionRetType, ok bool) { + return getUpdateVolumePayloadGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *UpdateVolumePayload) 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 *UpdateVolumePayload) SetDescription(v *string) { - o.Description = v +func (o *UpdateVolumePayload) SetDescription(v UpdateVolumePayloadGetDescriptionRetType) { + setUpdateVolumePayloadGetDescriptionAttributeType(&o.Description, v) } // GetImageConfig returns the ImageConfig field value if set, zero value otherwise. -func (o *UpdateVolumePayload) GetImageConfig() *ImageConfig { - if o == nil || IsNil(o.ImageConfig) { - var ret *ImageConfig - return ret - } - return o.ImageConfig +func (o *UpdateVolumePayload) GetImageConfig() (res UpdateVolumePayloadGetImageConfigRetType) { + res, _ = o.GetImageConfigOk() + return } // GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateVolumePayload) GetImageConfigOk() (*ImageConfig, bool) { - if o == nil || IsNil(o.ImageConfig) { - return nil, false - } - return o.ImageConfig, true +func (o *UpdateVolumePayload) GetImageConfigOk() (ret UpdateVolumePayloadGetImageConfigRetType, ok bool) { + return getUpdateVolumePayloadGetImageConfigAttributeTypeOk(o.ImageConfig) } // HasImageConfig returns a boolean if a field has been set. func (o *UpdateVolumePayload) HasImageConfig() bool { - if o != nil && !IsNil(o.ImageConfig) { - return true - } - - return false + _, ok := o.GetImageConfigOk() + return ok } // SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. -func (o *UpdateVolumePayload) SetImageConfig(v *ImageConfig) { - o.ImageConfig = v +func (o *UpdateVolumePayload) SetImageConfig(v UpdateVolumePayloadGetImageConfigRetType) { + setUpdateVolumePayloadGetImageConfigAttributeType(&o.ImageConfig, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateVolumePayload) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *UpdateVolumePayload) GetLabels() (res UpdateVolumePayloadGetLabelsRetType) { + 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 *UpdateVolumePayload) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *UpdateVolumePayload) GetLabelsOk() (ret UpdateVolumePayloadGetLabelsRetType, ok bool) { + return getUpdateVolumePayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *UpdateVolumePayload) 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 *UpdateVolumePayload) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *UpdateVolumePayload) SetLabels(v UpdateVolumePayloadGetLabelsRetType) { + setUpdateVolumePayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateVolumePayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *UpdateVolumePayload) GetName() (res UpdateVolumePayloadGetNameRetType) { + 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 *UpdateVolumePayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *UpdateVolumePayload) GetNameOk() (ret UpdateVolumePayloadGetNameRetType, ok bool) { + return getUpdateVolumePayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *UpdateVolumePayload) 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 *UpdateVolumePayload) SetName(v *string) { - o.Name = v +func (o *UpdateVolumePayload) SetName(v UpdateVolumePayloadGetNameRetType) { + setUpdateVolumePayloadGetNameAttributeType(&o.Name, v) } func (o UpdateVolumePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Bootable) { - toSerialize["bootable"] = o.Bootable + if val, ok := getUpdateVolumePayloadgetBootableAttributeTypeOk(o.Bootable); ok { + toSerialize["Bootable"] = val } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getUpdateVolumePayloadGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val } - if !IsNil(o.ImageConfig) { - toSerialize["imageConfig"] = o.ImageConfig + if val, ok := getUpdateVolumePayloadGetImageConfigAttributeTypeOk(o.ImageConfig); ok { + toSerialize["ImageConfig"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getUpdateVolumePayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getUpdateVolumePayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } return toSerialize, nil } diff --git a/services/iaas/model_volume.go b/services/iaas/model_volume.go index 70edc95bd..c451df5e2 100644 --- a/services/iaas/model_volume.go +++ b/services/iaas/model_volume.go @@ -18,35 +18,322 @@ import ( // checks if the Volume type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Volume{} +/* + types and functions for availabilityZone +*/ + +// isNotNullableString +type VolumeGetAvailabilityZoneAttributeType = *string + +func getVolumeGetAvailabilityZoneAttributeTypeOk(arg VolumeGetAvailabilityZoneAttributeType) (ret VolumeGetAvailabilityZoneRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeGetAvailabilityZoneAttributeType(arg *VolumeGetAvailabilityZoneAttributeType, val VolumeGetAvailabilityZoneRetType) { + *arg = &val +} + +type VolumeGetAvailabilityZoneArgType = string +type VolumeGetAvailabilityZoneRetType = string + +/* + types and functions for bootable +*/ + +// isBoolean +type VolumegetBootableAttributeType = *bool +type VolumegetBootableArgType = bool +type VolumegetBootableRetType = bool + +func getVolumegetBootableAttributeTypeOk(arg VolumegetBootableAttributeType) (ret VolumegetBootableRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumegetBootableAttributeType(arg *VolumegetBootableAttributeType, val VolumegetBootableRetType) { + *arg = &val +} + +/* + types and functions for createdAt +*/ + +// isDateTime +type VolumeGetCreatedAtAttributeType = *time.Time +type VolumeGetCreatedAtArgType = time.Time +type VolumeGetCreatedAtRetType = time.Time + +func getVolumeGetCreatedAtAttributeTypeOk(arg VolumeGetCreatedAtAttributeType) (ret VolumeGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeGetCreatedAtAttributeType(arg *VolumeGetCreatedAtAttributeType, val VolumeGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for description +*/ + +// isNotNullableString +type VolumeGetDescriptionAttributeType = *string + +func getVolumeGetDescriptionAttributeTypeOk(arg VolumeGetDescriptionAttributeType) (ret VolumeGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeGetDescriptionAttributeType(arg *VolumeGetDescriptionAttributeType, val VolumeGetDescriptionRetType) { + *arg = &val +} + +type VolumeGetDescriptionArgType = string +type VolumeGetDescriptionRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type VolumeGetIdAttributeType = *string + +func getVolumeGetIdAttributeTypeOk(arg VolumeGetIdAttributeType) (ret VolumeGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeGetIdAttributeType(arg *VolumeGetIdAttributeType, val VolumeGetIdRetType) { + *arg = &val +} + +type VolumeGetIdArgType = string +type VolumeGetIdRetType = string + +/* + types and functions for imageConfig +*/ + +// isModel +type VolumeGetImageConfigAttributeType = *ImageConfig +type VolumeGetImageConfigArgType = ImageConfig +type VolumeGetImageConfigRetType = ImageConfig + +func getVolumeGetImageConfigAttributeTypeOk(arg VolumeGetImageConfigAttributeType) (ret VolumeGetImageConfigRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeGetImageConfigAttributeType(arg *VolumeGetImageConfigAttributeType, val VolumeGetImageConfigRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isFreeform +type VolumeGetLabelsAttributeType = *map[string]interface{} +type VolumeGetLabelsArgType = map[string]interface{} +type VolumeGetLabelsRetType = map[string]interface{} + +func getVolumeGetLabelsAttributeTypeOk(arg VolumeGetLabelsAttributeType) (ret VolumeGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeGetLabelsAttributeType(arg *VolumeGetLabelsAttributeType, val VolumeGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type VolumeGetNameAttributeType = *string + +func getVolumeGetNameAttributeTypeOk(arg VolumeGetNameAttributeType) (ret VolumeGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeGetNameAttributeType(arg *VolumeGetNameAttributeType, val VolumeGetNameRetType) { + *arg = &val +} + +type VolumeGetNameArgType = string +type VolumeGetNameRetType = string + +/* + types and functions for performanceClass +*/ + +// isNotNullableString +type VolumeGetPerformanceClassAttributeType = *string + +func getVolumeGetPerformanceClassAttributeTypeOk(arg VolumeGetPerformanceClassAttributeType) (ret VolumeGetPerformanceClassRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeGetPerformanceClassAttributeType(arg *VolumeGetPerformanceClassAttributeType, val VolumeGetPerformanceClassRetType) { + *arg = &val +} + +type VolumeGetPerformanceClassArgType = string +type VolumeGetPerformanceClassRetType = string + +/* + types and functions for serverId +*/ + +// isNotNullableString +type VolumeGetServerIdAttributeType = *string + +func getVolumeGetServerIdAttributeTypeOk(arg VolumeGetServerIdAttributeType) (ret VolumeGetServerIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeGetServerIdAttributeType(arg *VolumeGetServerIdAttributeType, val VolumeGetServerIdRetType) { + *arg = &val +} + +type VolumeGetServerIdArgType = string +type VolumeGetServerIdRetType = string + +/* + types and functions for size +*/ + +// isLong +type VolumeGetSizeAttributeType = *int64 +type VolumeGetSizeArgType = int64 +type VolumeGetSizeRetType = int64 + +func getVolumeGetSizeAttributeTypeOk(arg VolumeGetSizeAttributeType) (ret VolumeGetSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeGetSizeAttributeType(arg *VolumeGetSizeAttributeType, val VolumeGetSizeRetType) { + *arg = &val +} + +/* + types and functions for source +*/ + +// isModel +type VolumeGetSourceAttributeType = *VolumeSource +type VolumeGetSourceArgType = VolumeSource +type VolumeGetSourceRetType = VolumeSource + +func getVolumeGetSourceAttributeTypeOk(arg VolumeGetSourceAttributeType) (ret VolumeGetSourceRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeGetSourceAttributeType(arg *VolumeGetSourceAttributeType, val VolumeGetSourceRetType) { + *arg = &val +} + +/* + types and functions for status +*/ + +// isNotNullableString +type VolumeGetStatusAttributeType = *string + +func getVolumeGetStatusAttributeTypeOk(arg VolumeGetStatusAttributeType) (ret VolumeGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeGetStatusAttributeType(arg *VolumeGetStatusAttributeType, val VolumeGetStatusRetType) { + *arg = &val +} + +type VolumeGetStatusArgType = string +type VolumeGetStatusRetType = string + +/* + types and functions for updatedAt +*/ + +// isDateTime +type VolumeGetUpdatedAtAttributeType = *time.Time +type VolumeGetUpdatedAtArgType = time.Time +type VolumeGetUpdatedAtRetType = time.Time + +func getVolumeGetUpdatedAtAttributeTypeOk(arg VolumeGetUpdatedAtAttributeType) (ret VolumeGetUpdatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeGetUpdatedAtAttributeType(arg *VolumeGetUpdatedAtAttributeType, val VolumeGetUpdatedAtRetType) { + *arg = &val +} + // Volume Object that represents a volume and its parameters. Used for Creating and returning (get/list). type Volume struct { // Object that represents an availability zone. // REQUIRED - AvailabilityZone *string `json:"availabilityZone"` + AvailabilityZone VolumeGetAvailabilityZoneAttributeType `json:"availabilityZone"` // Indicates if a volume is bootable. - Bootable *bool `json:"bootable,omitempty"` + Bootable VolumegetBootableAttributeType `json:"bootable,omitempty"` // Date-time when resource was created. - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt VolumeGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Description Object. Allows string up to 127 Characters. - Description *string `json:"description,omitempty"` + Description VolumeGetDescriptionAttributeType `json:"description,omitempty"` // Universally Unique Identifier (UUID). - Id *string `json:"id,omitempty"` - ImageConfig *ImageConfig `json:"imageConfig,omitempty"` + Id VolumeGetIdAttributeType `json:"id,omitempty"` + ImageConfig VolumeGetImageConfigAttributeType `json:"imageConfig,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels VolumeGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - Name *string `json:"name,omitempty"` + Name VolumeGetNameAttributeType `json:"name,omitempty"` // The name for a General Object. Matches Names and also UUIDs. - PerformanceClass *string `json:"performanceClass,omitempty"` + PerformanceClass VolumeGetPerformanceClassAttributeType `json:"performanceClass,omitempty"` // Universally Unique Identifier (UUID). - ServerId *string `json:"serverId,omitempty"` + ServerId VolumeGetServerIdAttributeType `json:"serverId,omitempty"` // Size in Gigabyte. - Size *int64 `json:"size,omitempty"` - Source *VolumeSource `json:"source,omitempty"` + Size VolumeGetSizeAttributeType `json:"size,omitempty"` + Source VolumeGetSourceAttributeType `json:"source,omitempty"` // The status of a volume object. Possible values: `ATTACHED`, `ATTACHING`, `AVAILABLE`, `AWAITING-TRANSFER`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `DETACHING`, `DOWNLOADING`, `ERROR`, `ERROR_BACKING-UP`, `ERROR_DELETING`, `ERROR_RESIZING`, `ERROR_RESTORING-BACKUP`, `MAINTENANCE`, `RESERVED`, `RESIZING`, `RESTORING-BACKUP`, `RETYPING`, `UPLOADING`. - Status *string `json:"status,omitempty"` + Status VolumeGetStatusAttributeType `json:"status,omitempty"` // Date-time when resource was last updated. - UpdatedAt *time.Time `json:"updatedAt,omitempty"` + UpdatedAt VolumeGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } type _Volume Volume @@ -55,9 +342,9 @@ type _Volume Volume // 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 NewVolume(availabilityZone *string) *Volume { +func NewVolume(availabilityZone VolumeGetAvailabilityZoneArgType) *Volume { this := Volume{} - this.AvailabilityZone = availabilityZone + setVolumeGetAvailabilityZoneAttributeType(&this.AvailabilityZone, availabilityZone) return &this } @@ -70,486 +357,364 @@ func NewVolumeWithDefaults() *Volume { } // GetAvailabilityZone returns the AvailabilityZone field value -func (o *Volume) GetAvailabilityZone() *string { - if o == nil || IsNil(o.AvailabilityZone) { - var ret *string - return ret - } - - return o.AvailabilityZone +func (o *Volume) GetAvailabilityZone() (ret VolumeGetAvailabilityZoneRetType) { + ret, _ = o.GetAvailabilityZoneOk() + return ret } // GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value // and a boolean to check if the value has been set. -func (o *Volume) GetAvailabilityZoneOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.AvailabilityZone, true +func (o *Volume) GetAvailabilityZoneOk() (ret VolumeGetAvailabilityZoneRetType, ok bool) { + return getVolumeGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) } // SetAvailabilityZone sets field value -func (o *Volume) SetAvailabilityZone(v *string) { - o.AvailabilityZone = v +func (o *Volume) SetAvailabilityZone(v VolumeGetAvailabilityZoneRetType) { + setVolumeGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) } // GetBootable returns the Bootable field value if set, zero value otherwise. -func (o *Volume) GetBootable() *bool { - if o == nil || IsNil(o.Bootable) { - var ret *bool - return ret - } - return o.Bootable +func (o *Volume) GetBootable() (res VolumegetBootableRetType) { + res, _ = o.GetBootableOk() + return } // GetBootableOk returns a tuple with the Bootable field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Volume) GetBootableOk() (*bool, bool) { - if o == nil || IsNil(o.Bootable) { - return nil, false - } - return o.Bootable, true +func (o *Volume) GetBootableOk() (ret VolumegetBootableRetType, ok bool) { + return getVolumegetBootableAttributeTypeOk(o.Bootable) } // HasBootable returns a boolean if a field has been set. func (o *Volume) HasBootable() bool { - if o != nil && !IsNil(o.Bootable) { - return true - } - - return false + _, ok := o.GetBootableOk() + return ok } // SetBootable gets a reference to the given bool and assigns it to the Bootable field. -func (o *Volume) SetBootable(v *bool) { - o.Bootable = v +func (o *Volume) SetBootable(v VolumegetBootableRetType) { + setVolumegetBootableAttributeType(&o.Bootable, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *Volume) GetCreatedAt() *time.Time { - if o == nil || IsNil(o.CreatedAt) { - var ret *time.Time - return ret - } - return o.CreatedAt +func (o *Volume) GetCreatedAt() (res VolumeGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return } // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Volume) GetCreatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreatedAt) { - return nil, false - } - return o.CreatedAt, true +func (o *Volume) GetCreatedAtOk() (ret VolumeGetCreatedAtRetType, ok bool) { + return getVolumeGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. func (o *Volume) HasCreatedAt() bool { - if o != nil && !IsNil(o.CreatedAt) { - return true - } - - return false + _, ok := o.GetCreatedAtOk() + return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. -func (o *Volume) SetCreatedAt(v *time.Time) { - o.CreatedAt = v +func (o *Volume) SetCreatedAt(v VolumeGetCreatedAtRetType) { + setVolumeGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *Volume) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *Volume) GetDescription() (res VolumeGetDescriptionRetType) { + 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 *Volume) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *Volume) GetDescriptionOk() (ret VolumeGetDescriptionRetType, ok bool) { + return getVolumeGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *Volume) 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 *Volume) SetDescription(v *string) { - o.Description = v +func (o *Volume) SetDescription(v VolumeGetDescriptionRetType) { + setVolumeGetDescriptionAttributeType(&o.Description, v) } // GetId returns the Id field value if set, zero value otherwise. -func (o *Volume) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *Volume) GetId() (res VolumeGetIdRetType) { + 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 *Volume) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *Volume) GetIdOk() (ret VolumeGetIdRetType, ok bool) { + return getVolumeGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *Volume) 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 *Volume) SetId(v *string) { - o.Id = v +func (o *Volume) SetId(v VolumeGetIdRetType) { + setVolumeGetIdAttributeType(&o.Id, v) } // GetImageConfig returns the ImageConfig field value if set, zero value otherwise. -func (o *Volume) GetImageConfig() *ImageConfig { - if o == nil || IsNil(o.ImageConfig) { - var ret *ImageConfig - return ret - } - return o.ImageConfig +func (o *Volume) GetImageConfig() (res VolumeGetImageConfigRetType) { + res, _ = o.GetImageConfigOk() + return } // GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Volume) GetImageConfigOk() (*ImageConfig, bool) { - if o == nil || IsNil(o.ImageConfig) { - return nil, false - } - return o.ImageConfig, true +func (o *Volume) GetImageConfigOk() (ret VolumeGetImageConfigRetType, ok bool) { + return getVolumeGetImageConfigAttributeTypeOk(o.ImageConfig) } // HasImageConfig returns a boolean if a field has been set. func (o *Volume) HasImageConfig() bool { - if o != nil && !IsNil(o.ImageConfig) { - return true - } - - return false + _, ok := o.GetImageConfigOk() + return ok } // SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. -func (o *Volume) SetImageConfig(v *ImageConfig) { - o.ImageConfig = v +func (o *Volume) SetImageConfig(v VolumeGetImageConfigRetType) { + setVolumeGetImageConfigAttributeType(&o.ImageConfig, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *Volume) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *Volume) GetLabels() (res VolumeGetLabelsRetType) { + 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 *Volume) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *Volume) GetLabelsOk() (ret VolumeGetLabelsRetType, ok bool) { + return getVolumeGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *Volume) 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 *Volume) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *Volume) SetLabels(v VolumeGetLabelsRetType) { + setVolumeGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *Volume) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *Volume) GetName() (res VolumeGetNameRetType) { + 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 *Volume) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *Volume) GetNameOk() (ret VolumeGetNameRetType, ok bool) { + return getVolumeGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *Volume) 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 *Volume) SetName(v *string) { - o.Name = v +func (o *Volume) SetName(v VolumeGetNameRetType) { + setVolumeGetNameAttributeType(&o.Name, v) } // GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. -func (o *Volume) GetPerformanceClass() *string { - if o == nil || IsNil(o.PerformanceClass) { - var ret *string - return ret - } - return o.PerformanceClass +func (o *Volume) GetPerformanceClass() (res VolumeGetPerformanceClassRetType) { + res, _ = o.GetPerformanceClassOk() + return } // GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Volume) GetPerformanceClassOk() (*string, bool) { - if o == nil || IsNil(o.PerformanceClass) { - return nil, false - } - return o.PerformanceClass, true +func (o *Volume) GetPerformanceClassOk() (ret VolumeGetPerformanceClassRetType, ok bool) { + return getVolumeGetPerformanceClassAttributeTypeOk(o.PerformanceClass) } // HasPerformanceClass returns a boolean if a field has been set. func (o *Volume) HasPerformanceClass() bool { - if o != nil && !IsNil(o.PerformanceClass) { - return true - } - - return false + _, ok := o.GetPerformanceClassOk() + return ok } // SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. -func (o *Volume) SetPerformanceClass(v *string) { - o.PerformanceClass = v +func (o *Volume) SetPerformanceClass(v VolumeGetPerformanceClassRetType) { + setVolumeGetPerformanceClassAttributeType(&o.PerformanceClass, v) } // GetServerId returns the ServerId field value if set, zero value otherwise. -func (o *Volume) GetServerId() *string { - if o == nil || IsNil(o.ServerId) { - var ret *string - return ret - } - return o.ServerId +func (o *Volume) GetServerId() (res VolumeGetServerIdRetType) { + res, _ = o.GetServerIdOk() + return } // GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Volume) GetServerIdOk() (*string, bool) { - if o == nil || IsNil(o.ServerId) { - return nil, false - } - return o.ServerId, true +func (o *Volume) GetServerIdOk() (ret VolumeGetServerIdRetType, ok bool) { + return getVolumeGetServerIdAttributeTypeOk(o.ServerId) } // HasServerId returns a boolean if a field has been set. func (o *Volume) HasServerId() bool { - if o != nil && !IsNil(o.ServerId) { - return true - } - - return false + _, ok := o.GetServerIdOk() + return ok } // SetServerId gets a reference to the given string and assigns it to the ServerId field. -func (o *Volume) SetServerId(v *string) { - o.ServerId = v +func (o *Volume) SetServerId(v VolumeGetServerIdRetType) { + setVolumeGetServerIdAttributeType(&o.ServerId, v) } // GetSize returns the Size field value if set, zero value otherwise. -func (o *Volume) GetSize() *int64 { - if o == nil || IsNil(o.Size) { - var ret *int64 - return ret - } - return o.Size +func (o *Volume) GetSize() (res VolumeGetSizeRetType) { + 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 *Volume) GetSizeOk() (*int64, bool) { - if o == nil || IsNil(o.Size) { - return nil, false - } - return o.Size, true +func (o *Volume) GetSizeOk() (ret VolumeGetSizeRetType, ok bool) { + return getVolumeGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. func (o *Volume) 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 *Volume) SetSize(v *int64) { - o.Size = v +func (o *Volume) SetSize(v VolumeGetSizeRetType) { + setVolumeGetSizeAttributeType(&o.Size, v) } // GetSource returns the Source field value if set, zero value otherwise. -func (o *Volume) GetSource() *VolumeSource { - if o == nil || IsNil(o.Source) { - var ret *VolumeSource - return ret - } - return o.Source +func (o *Volume) GetSource() (res VolumeGetSourceRetType) { + res, _ = o.GetSourceOk() + return } // GetSourceOk returns a tuple with the Source field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Volume) GetSourceOk() (*VolumeSource, bool) { - if o == nil || IsNil(o.Source) { - return nil, false - } - return o.Source, true +func (o *Volume) GetSourceOk() (ret VolumeGetSourceRetType, ok bool) { + return getVolumeGetSourceAttributeTypeOk(o.Source) } // HasSource returns a boolean if a field has been set. func (o *Volume) HasSource() bool { - if o != nil && !IsNil(o.Source) { - return true - } - - return false + _, ok := o.GetSourceOk() + return ok } // SetSource gets a reference to the given VolumeSource and assigns it to the Source field. -func (o *Volume) SetSource(v *VolumeSource) { - o.Source = v +func (o *Volume) SetSource(v VolumeGetSourceRetType) { + setVolumeGetSourceAttributeType(&o.Source, v) } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *Volume) GetStatus() *string { - if o == nil || IsNil(o.Status) { - var ret *string - return ret - } - return o.Status +func (o *Volume) GetStatus() (res VolumeGetStatusRetType) { + 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 *Volume) GetStatusOk() (*string, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true +func (o *Volume) GetStatusOk() (ret VolumeGetStatusRetType, ok bool) { + return getVolumeGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. func (o *Volume) 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 *Volume) SetStatus(v *string) { - o.Status = v +func (o *Volume) SetStatus(v VolumeGetStatusRetType) { + setVolumeGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *Volume) GetUpdatedAt() *time.Time { - if o == nil || IsNil(o.UpdatedAt) { - var ret *time.Time - return ret - } - return o.UpdatedAt +func (o *Volume) GetUpdatedAt() (res VolumeGetUpdatedAtRetType) { + res, _ = o.GetUpdatedAtOk() + return } // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Volume) GetUpdatedAtOk() (*time.Time, bool) { - if o == nil || IsNil(o.UpdatedAt) { - return nil, false - } - return o.UpdatedAt, true +func (o *Volume) GetUpdatedAtOk() (ret VolumeGetUpdatedAtRetType, ok bool) { + return getVolumeGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. func (o *Volume) HasUpdatedAt() bool { - if o != nil && !IsNil(o.UpdatedAt) { - return true - } - - return false + _, ok := o.GetUpdatedAtOk() + return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -func (o *Volume) SetUpdatedAt(v *time.Time) { - o.UpdatedAt = v +func (o *Volume) SetUpdatedAt(v VolumeGetUpdatedAtRetType) { + setVolumeGetUpdatedAtAttributeType(&o.UpdatedAt, v) } func (o Volume) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["availabilityZone"] = o.AvailabilityZone - if !IsNil(o.Bootable) { - toSerialize["bootable"] = o.Bootable + if val, ok := getVolumeGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { + toSerialize["AvailabilityZone"] = val + } + if val, ok := getVolumegetBootableAttributeTypeOk(o.Bootable); ok { + toSerialize["Bootable"] = val } - if !IsNil(o.CreatedAt) { - toSerialize["createdAt"] = o.CreatedAt + if val, ok := getVolumeGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getVolumeGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getVolumeGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.ImageConfig) { - toSerialize["imageConfig"] = o.ImageConfig + if val, ok := getVolumeGetImageConfigAttributeTypeOk(o.ImageConfig); ok { + toSerialize["ImageConfig"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getVolumeGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getVolumeGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.PerformanceClass) { - toSerialize["performanceClass"] = o.PerformanceClass + if val, ok := getVolumeGetPerformanceClassAttributeTypeOk(o.PerformanceClass); ok { + toSerialize["PerformanceClass"] = val } - if !IsNil(o.ServerId) { - toSerialize["serverId"] = o.ServerId + if val, ok := getVolumeGetServerIdAttributeTypeOk(o.ServerId); ok { + toSerialize["ServerId"] = val } - if !IsNil(o.Size) { - toSerialize["size"] = o.Size + if val, ok := getVolumeGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val } - if !IsNil(o.Source) { - toSerialize["source"] = o.Source + if val, ok := getVolumeGetSourceAttributeTypeOk(o.Source); ok { + toSerialize["Source"] = val } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status + if val, ok := getVolumeGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } - if !IsNil(o.UpdatedAt) { - toSerialize["updatedAt"] = o.UpdatedAt + if val, ok := getVolumeGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { + toSerialize["UpdatedAt"] = val } return toSerialize, nil } diff --git a/services/iaas/model_volume_attachment.go b/services/iaas/model_volume_attachment.go index a4865527b..421c94b9e 100644 --- a/services/iaas/model_volume_attachment.go +++ b/services/iaas/model_volume_attachment.go @@ -17,14 +17,76 @@ import ( // checks if the VolumeAttachment type satisfies the MappedNullable interface at compile time var _ MappedNullable = &VolumeAttachment{} +/* + types and functions for deleteOnTermination +*/ + +// isBoolean +type VolumeAttachmentgetDeleteOnTerminationAttributeType = *bool +type VolumeAttachmentgetDeleteOnTerminationArgType = bool +type VolumeAttachmentgetDeleteOnTerminationRetType = bool + +func getVolumeAttachmentgetDeleteOnTerminationAttributeTypeOk(arg VolumeAttachmentgetDeleteOnTerminationAttributeType) (ret VolumeAttachmentgetDeleteOnTerminationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeAttachmentgetDeleteOnTerminationAttributeType(arg *VolumeAttachmentgetDeleteOnTerminationAttributeType, val VolumeAttachmentgetDeleteOnTerminationRetType) { + *arg = &val +} + +/* + types and functions for serverId +*/ + +// isNotNullableString +type VolumeAttachmentGetServerIdAttributeType = *string + +func getVolumeAttachmentGetServerIdAttributeTypeOk(arg VolumeAttachmentGetServerIdAttributeType) (ret VolumeAttachmentGetServerIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeAttachmentGetServerIdAttributeType(arg *VolumeAttachmentGetServerIdAttributeType, val VolumeAttachmentGetServerIdRetType) { + *arg = &val +} + +type VolumeAttachmentGetServerIdArgType = string +type VolumeAttachmentGetServerIdRetType = string + +/* + types and functions for volumeId +*/ + +// isNotNullableString +type VolumeAttachmentGetVolumeIdAttributeType = *string + +func getVolumeAttachmentGetVolumeIdAttributeTypeOk(arg VolumeAttachmentGetVolumeIdAttributeType) (ret VolumeAttachmentGetVolumeIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeAttachmentGetVolumeIdAttributeType(arg *VolumeAttachmentGetVolumeIdAttributeType, val VolumeAttachmentGetVolumeIdRetType) { + *arg = &val +} + +type VolumeAttachmentGetVolumeIdArgType = string +type VolumeAttachmentGetVolumeIdRetType = string + // VolumeAttachment Object that represents a Volume attachment to a server. type VolumeAttachment struct { // Delete the volume during the termination of the server. Defaults to false. - DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` + DeleteOnTermination VolumeAttachmentgetDeleteOnTerminationAttributeType `json:"deleteOnTermination,omitempty"` // Universally Unique Identifier (UUID). - ServerId *string `json:"serverId,omitempty"` + ServerId VolumeAttachmentGetServerIdAttributeType `json:"serverId,omitempty"` // Universally Unique Identifier (UUID). - VolumeId *string `json:"volumeId,omitempty"` + VolumeId VolumeAttachmentGetVolumeIdAttributeType `json:"volumeId,omitempty"` } // NewVolumeAttachment instantiates a new VolumeAttachment object @@ -45,111 +107,84 @@ func NewVolumeAttachmentWithDefaults() *VolumeAttachment { } // GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. -func (o *VolumeAttachment) GetDeleteOnTermination() *bool { - if o == nil || IsNil(o.DeleteOnTermination) { - var ret *bool - return ret - } - return o.DeleteOnTermination +func (o *VolumeAttachment) GetDeleteOnTermination() (res VolumeAttachmentgetDeleteOnTerminationRetType) { + res, _ = o.GetDeleteOnTerminationOk() + return } // GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *VolumeAttachment) GetDeleteOnTerminationOk() (*bool, bool) { - if o == nil || IsNil(o.DeleteOnTermination) { - return nil, false - } - return o.DeleteOnTermination, true +func (o *VolumeAttachment) GetDeleteOnTerminationOk() (ret VolumeAttachmentgetDeleteOnTerminationRetType, ok bool) { + return getVolumeAttachmentgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination) } // HasDeleteOnTermination returns a boolean if a field has been set. func (o *VolumeAttachment) HasDeleteOnTermination() bool { - if o != nil && !IsNil(o.DeleteOnTermination) { - return true - } - - return false + _, ok := o.GetDeleteOnTerminationOk() + return ok } // SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. -func (o *VolumeAttachment) SetDeleteOnTermination(v *bool) { - o.DeleteOnTermination = v +func (o *VolumeAttachment) SetDeleteOnTermination(v VolumeAttachmentgetDeleteOnTerminationRetType) { + setVolumeAttachmentgetDeleteOnTerminationAttributeType(&o.DeleteOnTermination, v) } // GetServerId returns the ServerId field value if set, zero value otherwise. -func (o *VolumeAttachment) GetServerId() *string { - if o == nil || IsNil(o.ServerId) { - var ret *string - return ret - } - return o.ServerId +func (o *VolumeAttachment) GetServerId() (res VolumeAttachmentGetServerIdRetType) { + res, _ = o.GetServerIdOk() + return } // GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *VolumeAttachment) GetServerIdOk() (*string, bool) { - if o == nil || IsNil(o.ServerId) { - return nil, false - } - return o.ServerId, true +func (o *VolumeAttachment) GetServerIdOk() (ret VolumeAttachmentGetServerIdRetType, ok bool) { + return getVolumeAttachmentGetServerIdAttributeTypeOk(o.ServerId) } // HasServerId returns a boolean if a field has been set. func (o *VolumeAttachment) HasServerId() bool { - if o != nil && !IsNil(o.ServerId) { - return true - } - - return false + _, ok := o.GetServerIdOk() + return ok } // SetServerId gets a reference to the given string and assigns it to the ServerId field. -func (o *VolumeAttachment) SetServerId(v *string) { - o.ServerId = v +func (o *VolumeAttachment) SetServerId(v VolumeAttachmentGetServerIdRetType) { + setVolumeAttachmentGetServerIdAttributeType(&o.ServerId, v) } // GetVolumeId returns the VolumeId field value if set, zero value otherwise. -func (o *VolumeAttachment) GetVolumeId() *string { - if o == nil || IsNil(o.VolumeId) { - var ret *string - return ret - } - return o.VolumeId +func (o *VolumeAttachment) GetVolumeId() (res VolumeAttachmentGetVolumeIdRetType) { + res, _ = o.GetVolumeIdOk() + return } // GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *VolumeAttachment) GetVolumeIdOk() (*string, bool) { - if o == nil || IsNil(o.VolumeId) { - return nil, false - } - return o.VolumeId, true +func (o *VolumeAttachment) GetVolumeIdOk() (ret VolumeAttachmentGetVolumeIdRetType, ok bool) { + return getVolumeAttachmentGetVolumeIdAttributeTypeOk(o.VolumeId) } // HasVolumeId returns a boolean if a field has been set. func (o *VolumeAttachment) HasVolumeId() bool { - if o != nil && !IsNil(o.VolumeId) { - return true - } - - return false + _, ok := o.GetVolumeIdOk() + return ok } // SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. -func (o *VolumeAttachment) SetVolumeId(v *string) { - o.VolumeId = v +func (o *VolumeAttachment) SetVolumeId(v VolumeAttachmentGetVolumeIdRetType) { + setVolumeAttachmentGetVolumeIdAttributeType(&o.VolumeId, v) } func (o VolumeAttachment) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.DeleteOnTermination) { - toSerialize["deleteOnTermination"] = o.DeleteOnTermination + if val, ok := getVolumeAttachmentgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination); ok { + toSerialize["DeleteOnTermination"] = val } - if !IsNil(o.ServerId) { - toSerialize["serverId"] = o.ServerId + if val, ok := getVolumeAttachmentGetServerIdAttributeTypeOk(o.ServerId); ok { + toSerialize["ServerId"] = val } - if !IsNil(o.VolumeId) { - toSerialize["volumeId"] = o.VolumeId + if val, ok := getVolumeAttachmentGetVolumeIdAttributeTypeOk(o.VolumeId); ok { + toSerialize["VolumeId"] = val } return toSerialize, nil } diff --git a/services/iaas/model_volume_attachment_list_response.go b/services/iaas/model_volume_attachment_list_response.go index 60dcb3717..df157b268 100644 --- a/services/iaas/model_volume_attachment_list_response.go +++ b/services/iaas/model_volume_attachment_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the VolumeAttachmentListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &VolumeAttachmentListResponse{} +/* + types and functions for items +*/ + +// isArray +type VolumeAttachmentListResponseGetItemsAttributeType = *[]VolumeAttachment +type VolumeAttachmentListResponseGetItemsArgType = []VolumeAttachment +type VolumeAttachmentListResponseGetItemsRetType = []VolumeAttachment + +func getVolumeAttachmentListResponseGetItemsAttributeTypeOk(arg VolumeAttachmentListResponseGetItemsAttributeType) (ret VolumeAttachmentListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeAttachmentListResponseGetItemsAttributeType(arg *VolumeAttachmentListResponseGetItemsAttributeType, val VolumeAttachmentListResponseGetItemsRetType) { + *arg = &val +} + // VolumeAttachmentListResponse Volume attachment list response. type VolumeAttachmentListResponse struct { // A list containing Volume attachments of a server. // REQUIRED - Items *[]VolumeAttachment `json:"items"` + Items VolumeAttachmentListResponseGetItemsAttributeType `json:"items"` } type _VolumeAttachmentListResponse VolumeAttachmentListResponse @@ -30,9 +50,9 @@ type _VolumeAttachmentListResponse VolumeAttachmentListResponse // 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 NewVolumeAttachmentListResponse(items *[]VolumeAttachment) *VolumeAttachmentListResponse { +func NewVolumeAttachmentListResponse(items VolumeAttachmentListResponseGetItemsArgType) *VolumeAttachmentListResponse { this := VolumeAttachmentListResponse{} - this.Items = items + setVolumeAttachmentListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewVolumeAttachmentListResponseWithDefaults() *VolumeAttachmentListResponse } // GetItems returns the Items field value -func (o *VolumeAttachmentListResponse) GetItems() *[]VolumeAttachment { - if o == nil || IsNil(o.Items) { - var ret *[]VolumeAttachment - return ret - } - - return o.Items +func (o *VolumeAttachmentListResponse) GetItems() (ret VolumeAttachmentListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *VolumeAttachmentListResponse) GetItemsOk() (*[]VolumeAttachment, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *VolumeAttachmentListResponse) GetItemsOk() (ret VolumeAttachmentListResponseGetItemsRetType, ok bool) { + return getVolumeAttachmentListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *VolumeAttachmentListResponse) SetItems(v *[]VolumeAttachment) { - o.Items = v +func (o *VolumeAttachmentListResponse) SetItems(v VolumeAttachmentListResponseGetItemsRetType) { + setVolumeAttachmentListResponseGetItemsAttributeType(&o.Items, v) } func (o VolumeAttachmentListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getVolumeAttachmentListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_volume_list_response.go b/services/iaas/model_volume_list_response.go index db92419cb..924c3af9d 100644 --- a/services/iaas/model_volume_list_response.go +++ b/services/iaas/model_volume_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the VolumeListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &VolumeListResponse{} +/* + types and functions for items +*/ + +// isArray +type VolumeListResponseGetItemsAttributeType = *[]Volume +type VolumeListResponseGetItemsArgType = []Volume +type VolumeListResponseGetItemsRetType = []Volume + +func getVolumeListResponseGetItemsAttributeTypeOk(arg VolumeListResponseGetItemsAttributeType) (ret VolumeListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeListResponseGetItemsAttributeType(arg *VolumeListResponseGetItemsAttributeType, val VolumeListResponseGetItemsRetType) { + *arg = &val +} + // VolumeListResponse Volume list response. type VolumeListResponse struct { // A list containing volume objects. // REQUIRED - Items *[]Volume `json:"items"` + Items VolumeListResponseGetItemsAttributeType `json:"items"` } type _VolumeListResponse VolumeListResponse @@ -30,9 +50,9 @@ type _VolumeListResponse VolumeListResponse // 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 NewVolumeListResponse(items *[]Volume) *VolumeListResponse { +func NewVolumeListResponse(items VolumeListResponseGetItemsArgType) *VolumeListResponse { this := VolumeListResponse{} - this.Items = items + setVolumeListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewVolumeListResponseWithDefaults() *VolumeListResponse { } // GetItems returns the Items field value -func (o *VolumeListResponse) GetItems() *[]Volume { - if o == nil || IsNil(o.Items) { - var ret *[]Volume - return ret - } - - return o.Items +func (o *VolumeListResponse) GetItems() (ret VolumeListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *VolumeListResponse) GetItemsOk() (*[]Volume, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *VolumeListResponse) GetItemsOk() (ret VolumeListResponseGetItemsRetType, ok bool) { + return getVolumeListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *VolumeListResponse) SetItems(v *[]Volume) { - o.Items = v +func (o *VolumeListResponse) SetItems(v VolumeListResponseGetItemsRetType) { + setVolumeListResponseGetItemsAttributeType(&o.Items, v) } func (o VolumeListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getVolumeListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_volume_performance_class.go b/services/iaas/model_volume_performance_class.go index 6d5d936b0..76a87ee62 100644 --- a/services/iaas/model_volume_performance_class.go +++ b/services/iaas/model_volume_performance_class.go @@ -17,19 +17,121 @@ import ( // checks if the VolumePerformanceClass type satisfies the MappedNullable interface at compile time var _ MappedNullable = &VolumePerformanceClass{} +/* + types and functions for description +*/ + +// isNotNullableString +type VolumePerformanceClassGetDescriptionAttributeType = *string + +func getVolumePerformanceClassGetDescriptionAttributeTypeOk(arg VolumePerformanceClassGetDescriptionAttributeType) (ret VolumePerformanceClassGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumePerformanceClassGetDescriptionAttributeType(arg *VolumePerformanceClassGetDescriptionAttributeType, val VolumePerformanceClassGetDescriptionRetType) { + *arg = &val +} + +type VolumePerformanceClassGetDescriptionArgType = string +type VolumePerformanceClassGetDescriptionRetType = string + +/* + types and functions for iops +*/ + +// isLong +type VolumePerformanceClassGetIopsAttributeType = *int64 +type VolumePerformanceClassGetIopsArgType = int64 +type VolumePerformanceClassGetIopsRetType = int64 + +func getVolumePerformanceClassGetIopsAttributeTypeOk(arg VolumePerformanceClassGetIopsAttributeType) (ret VolumePerformanceClassGetIopsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumePerformanceClassGetIopsAttributeType(arg *VolumePerformanceClassGetIopsAttributeType, val VolumePerformanceClassGetIopsRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isFreeform +type VolumePerformanceClassGetLabelsAttributeType = *map[string]interface{} +type VolumePerformanceClassGetLabelsArgType = map[string]interface{} +type VolumePerformanceClassGetLabelsRetType = map[string]interface{} + +func getVolumePerformanceClassGetLabelsAttributeTypeOk(arg VolumePerformanceClassGetLabelsAttributeType) (ret VolumePerformanceClassGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumePerformanceClassGetLabelsAttributeType(arg *VolumePerformanceClassGetLabelsAttributeType, val VolumePerformanceClassGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type VolumePerformanceClassGetNameAttributeType = *string + +func getVolumePerformanceClassGetNameAttributeTypeOk(arg VolumePerformanceClassGetNameAttributeType) (ret VolumePerformanceClassGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumePerformanceClassGetNameAttributeType(arg *VolumePerformanceClassGetNameAttributeType, val VolumePerformanceClassGetNameRetType) { + *arg = &val +} + +type VolumePerformanceClassGetNameArgType = string +type VolumePerformanceClassGetNameRetType = string + +/* + types and functions for throughput +*/ + +// isLong +type VolumePerformanceClassGetThroughputAttributeType = *int64 +type VolumePerformanceClassGetThroughputArgType = int64 +type VolumePerformanceClassGetThroughputRetType = int64 + +func getVolumePerformanceClassGetThroughputAttributeTypeOk(arg VolumePerformanceClassGetThroughputAttributeType) (ret VolumePerformanceClassGetThroughputRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumePerformanceClassGetThroughputAttributeType(arg *VolumePerformanceClassGetThroughputAttributeType, val VolumePerformanceClassGetThroughputRetType) { + *arg = &val +} + // VolumePerformanceClass Object that represents a Volume performance class. type VolumePerformanceClass struct { // Description Object. Allows string up to 127 Characters. - Description *string `json:"description,omitempty"` + Description VolumePerformanceClassGetDescriptionAttributeType `json:"description,omitempty"` // Input/Output Operations per second. - Iops *int64 `json:"iops,omitempty"` + Iops VolumePerformanceClassGetIopsAttributeType `json:"iops,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. - Labels *map[string]interface{} `json:"labels,omitempty"` + Labels VolumePerformanceClassGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED - Name *string `json:"name"` + Name VolumePerformanceClassGetNameAttributeType `json:"name"` // Throughput in Megabyte per second. - Throughput *int64 `json:"throughput,omitempty"` + Throughput VolumePerformanceClassGetThroughputAttributeType `json:"throughput,omitempty"` } type _VolumePerformanceClass VolumePerformanceClass @@ -38,9 +140,9 @@ type _VolumePerformanceClass VolumePerformanceClass // 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 NewVolumePerformanceClass(name *string) *VolumePerformanceClass { +func NewVolumePerformanceClass(name VolumePerformanceClassGetNameArgType) *VolumePerformanceClass { this := VolumePerformanceClass{} - this.Name = name + setVolumePerformanceClassGetNameAttributeType(&this.Name, name) return &this } @@ -53,171 +155,130 @@ func NewVolumePerformanceClassWithDefaults() *VolumePerformanceClass { } // GetDescription returns the Description field value if set, zero value otherwise. -func (o *VolumePerformanceClass) GetDescription() *string { - if o == nil || IsNil(o.Description) { - var ret *string - return ret - } - return o.Description +func (o *VolumePerformanceClass) GetDescription() (res VolumePerformanceClassGetDescriptionRetType) { + 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 *VolumePerformanceClass) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true +func (o *VolumePerformanceClass) GetDescriptionOk() (ret VolumePerformanceClassGetDescriptionRetType, ok bool) { + return getVolumePerformanceClassGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *VolumePerformanceClass) 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 *VolumePerformanceClass) SetDescription(v *string) { - o.Description = v +func (o *VolumePerformanceClass) SetDescription(v VolumePerformanceClassGetDescriptionRetType) { + setVolumePerformanceClassGetDescriptionAttributeType(&o.Description, v) } // GetIops returns the Iops field value if set, zero value otherwise. -func (o *VolumePerformanceClass) GetIops() *int64 { - if o == nil || IsNil(o.Iops) { - var ret *int64 - return ret - } - return o.Iops +func (o *VolumePerformanceClass) GetIops() (res VolumePerformanceClassGetIopsRetType) { + res, _ = o.GetIopsOk() + return } // GetIopsOk returns a tuple with the Iops field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *VolumePerformanceClass) GetIopsOk() (*int64, bool) { - if o == nil || IsNil(o.Iops) { - return nil, false - } - return o.Iops, true +func (o *VolumePerformanceClass) GetIopsOk() (ret VolumePerformanceClassGetIopsRetType, ok bool) { + return getVolumePerformanceClassGetIopsAttributeTypeOk(o.Iops) } // HasIops returns a boolean if a field has been set. func (o *VolumePerformanceClass) HasIops() bool { - if o != nil && !IsNil(o.Iops) { - return true - } - - return false + _, ok := o.GetIopsOk() + return ok } // SetIops gets a reference to the given int64 and assigns it to the Iops field. -func (o *VolumePerformanceClass) SetIops(v *int64) { - o.Iops = v +func (o *VolumePerformanceClass) SetIops(v VolumePerformanceClassGetIopsRetType) { + setVolumePerformanceClassGetIopsAttributeType(&o.Iops, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *VolumePerformanceClass) GetLabels() *map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret *map[string]interface{} - return ret - } - return o.Labels +func (o *VolumePerformanceClass) GetLabels() (res VolumePerformanceClassGetLabelsRetType) { + 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 *VolumePerformanceClass) GetLabelsOk() (*map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return &map[string]interface{}{}, false - } - return o.Labels, true +func (o *VolumePerformanceClass) GetLabelsOk() (ret VolumePerformanceClassGetLabelsRetType, ok bool) { + return getVolumePerformanceClassGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *VolumePerformanceClass) 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 *VolumePerformanceClass) SetLabels(v *map[string]interface{}) { - o.Labels = v +func (o *VolumePerformanceClass) SetLabels(v VolumePerformanceClassGetLabelsRetType) { + setVolumePerformanceClassGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value -func (o *VolumePerformanceClass) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *VolumePerformanceClass) GetName() (ret VolumePerformanceClassGetNameRetType) { + 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 *VolumePerformanceClass) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *VolumePerformanceClass) GetNameOk() (ret VolumePerformanceClassGetNameRetType, ok bool) { + return getVolumePerformanceClassGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *VolumePerformanceClass) SetName(v *string) { - o.Name = v +func (o *VolumePerformanceClass) SetName(v VolumePerformanceClassGetNameRetType) { + setVolumePerformanceClassGetNameAttributeType(&o.Name, v) } // GetThroughput returns the Throughput field value if set, zero value otherwise. -func (o *VolumePerformanceClass) GetThroughput() *int64 { - if o == nil || IsNil(o.Throughput) { - var ret *int64 - return ret - } - return o.Throughput +func (o *VolumePerformanceClass) GetThroughput() (res VolumePerformanceClassGetThroughputRetType) { + res, _ = o.GetThroughputOk() + return } // GetThroughputOk returns a tuple with the Throughput field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *VolumePerformanceClass) GetThroughputOk() (*int64, bool) { - if o == nil || IsNil(o.Throughput) { - return nil, false - } - return o.Throughput, true +func (o *VolumePerformanceClass) GetThroughputOk() (ret VolumePerformanceClassGetThroughputRetType, ok bool) { + return getVolumePerformanceClassGetThroughputAttributeTypeOk(o.Throughput) } // HasThroughput returns a boolean if a field has been set. func (o *VolumePerformanceClass) HasThroughput() bool { - if o != nil && !IsNil(o.Throughput) { - return true - } - - return false + _, ok := o.GetThroughputOk() + return ok } // SetThroughput gets a reference to the given int64 and assigns it to the Throughput field. -func (o *VolumePerformanceClass) SetThroughput(v *int64) { - o.Throughput = v +func (o *VolumePerformanceClass) SetThroughput(v VolumePerformanceClassGetThroughputRetType) { + setVolumePerformanceClassGetThroughputAttributeType(&o.Throughput, v) } func (o VolumePerformanceClass) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Description) { - toSerialize["description"] = o.Description + if val, ok := getVolumePerformanceClassGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getVolumePerformanceClassGetIopsAttributeTypeOk(o.Iops); ok { + toSerialize["Iops"] = val } - if !IsNil(o.Iops) { - toSerialize["iops"] = o.Iops + if val, ok := getVolumePerformanceClassGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getVolumePerformanceClassGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - toSerialize["name"] = o.Name - if !IsNil(o.Throughput) { - toSerialize["throughput"] = o.Throughput + if val, ok := getVolumePerformanceClassGetThroughputAttributeTypeOk(o.Throughput); ok { + toSerialize["Throughput"] = val } return toSerialize, nil } diff --git a/services/iaas/model_volume_performance_class_list_response.go b/services/iaas/model_volume_performance_class_list_response.go index 83b346e2a..bab673ec9 100644 --- a/services/iaas/model_volume_performance_class_list_response.go +++ b/services/iaas/model_volume_performance_class_list_response.go @@ -17,11 +17,31 @@ import ( // checks if the VolumePerformanceClassListResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &VolumePerformanceClassListResponse{} +/* + types and functions for items +*/ + +// isArray +type VolumePerformanceClassListResponseGetItemsAttributeType = *[]VolumePerformanceClass +type VolumePerformanceClassListResponseGetItemsArgType = []VolumePerformanceClass +type VolumePerformanceClassListResponseGetItemsRetType = []VolumePerformanceClass + +func getVolumePerformanceClassListResponseGetItemsAttributeTypeOk(arg VolumePerformanceClassListResponseGetItemsAttributeType) (ret VolumePerformanceClassListResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumePerformanceClassListResponseGetItemsAttributeType(arg *VolumePerformanceClassListResponseGetItemsAttributeType, val VolumePerformanceClassListResponseGetItemsRetType) { + *arg = &val +} + // VolumePerformanceClassListResponse Volume performance class list response. type VolumePerformanceClassListResponse struct { // A list containing Volume performance classes. // REQUIRED - Items *[]VolumePerformanceClass `json:"items"` + Items VolumePerformanceClassListResponseGetItemsAttributeType `json:"items"` } type _VolumePerformanceClassListResponse VolumePerformanceClassListResponse @@ -30,9 +50,9 @@ type _VolumePerformanceClassListResponse VolumePerformanceClassListResponse // 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 NewVolumePerformanceClassListResponse(items *[]VolumePerformanceClass) *VolumePerformanceClassListResponse { +func NewVolumePerformanceClassListResponse(items VolumePerformanceClassListResponseGetItemsArgType) *VolumePerformanceClassListResponse { this := VolumePerformanceClassListResponse{} - this.Items = items + setVolumePerformanceClassListResponseGetItemsAttributeType(&this.Items, items) return &this } @@ -45,32 +65,27 @@ func NewVolumePerformanceClassListResponseWithDefaults() *VolumePerformanceClass } // GetItems returns the Items field value -func (o *VolumePerformanceClassListResponse) GetItems() *[]VolumePerformanceClass { - if o == nil || IsNil(o.Items) { - var ret *[]VolumePerformanceClass - return ret - } - - return o.Items +func (o *VolumePerformanceClassListResponse) GetItems() (ret VolumePerformanceClassListResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *VolumePerformanceClassListResponse) GetItemsOk() (*[]VolumePerformanceClass, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *VolumePerformanceClassListResponse) GetItemsOk() (ret VolumePerformanceClassListResponseGetItemsRetType, ok bool) { + return getVolumePerformanceClassListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *VolumePerformanceClassListResponse) SetItems(v *[]VolumePerformanceClass) { - o.Items = v +func (o *VolumePerformanceClassListResponse) SetItems(v VolumePerformanceClassListResponseGetItemsRetType) { + setVolumePerformanceClassListResponseGetItemsAttributeType(&o.Items, v) } func (o VolumePerformanceClassListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items + if val, ok := getVolumePerformanceClassListResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } return toSerialize, nil } diff --git a/services/iaas/model_volume_source.go b/services/iaas/model_volume_source.go index 62db77414..bde3f185f 100644 --- a/services/iaas/model_volume_source.go +++ b/services/iaas/model_volume_source.go @@ -17,14 +17,56 @@ import ( // checks if the VolumeSource type satisfies the MappedNullable interface at compile time var _ MappedNullable = &VolumeSource{} +/* + types and functions for id +*/ + +// isNotNullableString +type VolumeSourceGetIdAttributeType = *string + +func getVolumeSourceGetIdAttributeTypeOk(arg VolumeSourceGetIdAttributeType) (ret VolumeSourceGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeSourceGetIdAttributeType(arg *VolumeSourceGetIdAttributeType, val VolumeSourceGetIdRetType) { + *arg = &val +} + +type VolumeSourceGetIdArgType = string +type VolumeSourceGetIdRetType = string + +/* + types and functions for type +*/ + +// isNotNullableString +type VolumeSourceGetTypeAttributeType = *string + +func getVolumeSourceGetTypeAttributeTypeOk(arg VolumeSourceGetTypeAttributeType) (ret VolumeSourceGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeSourceGetTypeAttributeType(arg *VolumeSourceGetTypeAttributeType, val VolumeSourceGetTypeRetType) { + *arg = &val +} + +type VolumeSourceGetTypeArgType = string +type VolumeSourceGetTypeRetType = string + // VolumeSource The source object of a volume. type VolumeSource struct { // Universally Unique Identifier (UUID). // REQUIRED - Id *string `json:"id"` + Id VolumeSourceGetIdAttributeType `json:"id"` // The source types of a volume. Possible values: `image`, `volume`, `snapshot`, `backup`. // REQUIRED - Type *string `json:"type"` + Type VolumeSourceGetTypeAttributeType `json:"type"` } type _VolumeSource VolumeSource @@ -33,10 +75,10 @@ type _VolumeSource VolumeSource // 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 NewVolumeSource(id *string, type_ *string) *VolumeSource { +func NewVolumeSource(id VolumeSourceGetIdArgType, type_ VolumeSourceGetTypeArgType) *VolumeSource { this := VolumeSource{} - this.Id = id - this.Type = type_ + setVolumeSourceGetIdAttributeType(&this.Id, id) + setVolumeSourceGetTypeAttributeType(&this.Type, type_) return &this } @@ -49,57 +91,47 @@ func NewVolumeSourceWithDefaults() *VolumeSource { } // GetId returns the Id field value -func (o *VolumeSource) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - - return o.Id +func (o *VolumeSource) GetId() (ret VolumeSourceGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *VolumeSource) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *VolumeSource) GetIdOk() (ret VolumeSourceGetIdRetType, ok bool) { + return getVolumeSourceGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *VolumeSource) SetId(v *string) { - o.Id = v +func (o *VolumeSource) SetId(v VolumeSourceGetIdRetType) { + setVolumeSourceGetIdAttributeType(&o.Id, v) } // GetType returns the Type field value -func (o *VolumeSource) GetType() *string { - if o == nil || IsNil(o.Type) { - var ret *string - return ret - } - - return o.Type +func (o *VolumeSource) GetType() (ret VolumeSourceGetTypeRetType) { + ret, _ = o.GetTypeOk() + return ret } // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *VolumeSource) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Type, true +func (o *VolumeSource) GetTypeOk() (ret VolumeSourceGetTypeRetType, ok bool) { + return getVolumeSourceGetTypeAttributeTypeOk(o.Type) } // SetType sets field value -func (o *VolumeSource) SetType(v *string) { - o.Type = v +func (o *VolumeSource) SetType(v VolumeSourceGetTypeRetType) { + setVolumeSourceGetTypeAttributeType(&o.Type, v) } func (o VolumeSource) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["id"] = o.Id - toSerialize["type"] = o.Type + if val, ok := getVolumeSourceGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getVolumeSourceGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } return toSerialize, nil } diff --git a/services/iaas/utils.go b/services/iaas/utils.go index 7879769b3..0f1833e15 100644 --- a/services/iaas/utils.go +++ b/services/iaas/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()