diff --git a/services/ske/api_default_test.go b/services/ske/api_default_test.go index df4f74c4f..d0bb579f6 100644 --- a/services/ske/api_default_test.go +++ b/services/ske/api_default_test.go @@ -24,14 +24,14 @@ import ( func Test_ske_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService CompleteCredentialsRotation", func(t *testing.T) { - path := "/v1/projects/{projectId}/clusters/{clusterName}/complete-credentials-rotation" + _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}/complete-credentials-rotation" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) clusterNameValue := "clusterName" - path = strings.Replace(path, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -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 := map[string]interface{}{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -65,28 +65,28 @@ func Test_ske_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - clusterName := "clusterName" + projectId := projectIdValue + clusterName := clusterNameValue resp, reqErr := apiClient.CompleteCredentialsRotation(context.Background(), projectId, clusterName).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 CreateKubeconfig", func(t *testing.T) { - path := "/v1/projects/{projectId}/clusters/{clusterName}/kubeconfig" + _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}/kubeconfig" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) clusterNameValue := "clusterName" - path = strings.Replace(path, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -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 := Kubeconfig{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -120,8 +120,8 @@ func Test_ske_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - clusterName := "clusterName" + projectId := projectIdValue + clusterName := clusterNameValue createKubeconfigPayload := CreateKubeconfigPayload{} resp, reqErr := apiClient.CreateKubeconfig(context.Background(), projectId, clusterName).CreateKubeconfigPayload(createKubeconfigPayload).Execute() @@ -129,20 +129,20 @@ func Test_ske_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 CreateOrUpdateCluster", func(t *testing.T) { - path := "/v1/projects/{projectId}/clusters/{clusterName}" + _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) clusterNameValue := "clusterName" - path = strings.Replace(path, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -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 := Cluster{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -176,8 +176,8 @@ func Test_ske_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - clusterName := "clusterName" + projectId := projectIdValue + clusterName := clusterNameValue createOrUpdateClusterPayload := CreateOrUpdateClusterPayload{} resp, reqErr := apiClient.CreateOrUpdateCluster(context.Background(), projectId, clusterName).CreateOrUpdateClusterPayload(createOrUpdateClusterPayload).Execute() @@ -185,20 +185,20 @@ func Test_ske_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 DeleteCluster", func(t *testing.T) { - path := "/v1/projects/{projectId}/clusters/{clusterName}" + _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) clusterNameValue := "clusterName" - path = strings.Replace(path, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -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 := map[string]interface{}{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -232,28 +232,28 @@ func Test_ske_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - clusterName := "clusterName" + projectId := projectIdValue + clusterName := clusterNameValue resp, reqErr := apiClient.DeleteCluster(context.Background(), projectId, clusterName).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 GetCluster", func(t *testing.T) { - path := "/v1/projects/{projectId}/clusters/{clusterName}" + _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) clusterNameValue := "clusterName" - path = strings.Replace(path, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -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 := Cluster{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -287,28 +287,28 @@ func Test_ske_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - clusterName := "clusterName" + projectId := projectIdValue + clusterName := clusterNameValue resp, reqErr := apiClient.GetCluster(context.Background(), projectId, clusterName).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 GetLoginKubeconfig", func(t *testing.T) { - path := "/v1/projects/{projectId}/clusters/{clusterName}/kubeconfig/login" + _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}/kubeconfig/login" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) clusterNameValue := "clusterName" - path = strings.Replace(path, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -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 := LoginKubeconfig{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -342,26 +342,26 @@ func Test_ske_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - clusterName := "clusterName" + projectId := projectIdValue + clusterName := clusterNameValue resp, reqErr := apiClient.GetLoginKubeconfig(context.Background(), projectId, clusterName).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 ListClusters", func(t *testing.T) { - path := "/v1/projects/{projectId}/clusters" + _apiUrlPath := "/v1/projects/{projectId}/clusters" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _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 := ListClustersResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -395,23 +395,23 @@ func Test_ske_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" + projectId := projectIdValue resp, reqErr := apiClient.ListClusters(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 ListProviderOptions", func(t *testing.T) { - path := "/v1/provider-options" + _apiUrlPath := "/v1/provider-options" testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := ProviderOptions{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -450,20 +450,20 @@ func Test_ske_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 StartCredentialsRotation", func(t *testing.T) { - path := "/v1/projects/{projectId}/clusters/{clusterName}/start-credentials-rotation" + _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}/start-credentials-rotation" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) clusterNameValue := "clusterName" - path = strings.Replace(path, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -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 := map[string]interface{}{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -497,28 +497,28 @@ func Test_ske_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - clusterName := "clusterName" + projectId := projectIdValue + clusterName := clusterNameValue resp, reqErr := apiClient.StartCredentialsRotation(context.Background(), projectId, clusterName).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 TriggerHibernate", func(t *testing.T) { - path := "/v1/projects/{projectId}/clusters/{clusterName}/hibernate" + _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}/hibernate" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) clusterNameValue := "clusterName" - path = strings.Replace(path, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -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 := map[string]interface{}{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -552,28 +552,28 @@ func Test_ske_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - clusterName := "clusterName" + projectId := projectIdValue + clusterName := clusterNameValue resp, reqErr := apiClient.TriggerHibernate(context.Background(), projectId, clusterName).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 TriggerMaintenance", func(t *testing.T) { - path := "/v1/projects/{projectId}/clusters/{clusterName}/maintenance" + _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}/maintenance" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) clusterNameValue := "clusterName" - path = strings.Replace(path, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -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 := map[string]interface{}{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -607,28 +607,28 @@ func Test_ske_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - clusterName := "clusterName" + projectId := projectIdValue + clusterName := clusterNameValue resp, reqErr := apiClient.TriggerMaintenance(context.Background(), projectId, clusterName).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 TriggerReconcile", func(t *testing.T) { - path := "/v1/projects/{projectId}/clusters/{clusterName}/reconcile" + _apiUrlPath := "/v1/projects/{projectId}/clusters/{clusterName}/reconcile" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) clusterNameValue := "clusterName" - path = strings.Replace(path, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"clusterName"+"}", url.PathEscape(ParameterValueToString(clusterNameValue, "clusterName")), -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 := map[string]interface{}{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -662,15 +662,15 @@ func Test_ske_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - clusterName := "clusterName" + projectId := projectIdValue + clusterName := clusterNameValue resp, reqErr := apiClient.TriggerReconcile(context.Background(), projectId, clusterName).Execute() 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/ske/model_acl.go b/services/ske/model_acl.go index 4f1368fc1..bf9bfc252 100644 --- a/services/ske/model_acl.go +++ b/services/ske/model_acl.go @@ -17,14 +17,54 @@ import ( // checks if the ACL type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ACL{} +/* + types and functions for allowedCidrs +*/ + +// isArray +type ACLGetAllowedCidrsAttributeType = *[]string +type ACLGetAllowedCidrsArgType = []string +type ACLGetAllowedCidrsRetType = []string + +func getACLGetAllowedCidrsAttributeTypeOk(arg ACLGetAllowedCidrsAttributeType) (ret ACLGetAllowedCidrsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setACLGetAllowedCidrsAttributeType(arg *ACLGetAllowedCidrsAttributeType, val ACLGetAllowedCidrsRetType) { + *arg = &val +} + +/* + types and functions for enabled +*/ + +// isBoolean +type ACLgetEnabledAttributeType = *bool +type ACLgetEnabledArgType = bool +type ACLgetEnabledRetType = bool + +func getACLgetEnabledAttributeTypeOk(arg ACLgetEnabledAttributeType) (ret ACLgetEnabledRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setACLgetEnabledAttributeType(arg *ACLgetEnabledAttributeType, val ACLgetEnabledRetType) { + *arg = &val +} + // ACL struct for ACL type ACL struct { // Array of CIDRs to allow access to the kubernetes API. // REQUIRED - AllowedCidrs *[]string `json:"allowedCidrs"` + AllowedCidrs ACLGetAllowedCidrsAttributeType `json:"allowedCidrs"` // Enables the acl extension. // REQUIRED - Enabled *bool `json:"enabled"` + Enabled ACLgetEnabledAttributeType `json:"enabled"` } type _ACL ACL @@ -33,10 +73,10 @@ type _ACL ACL // 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 NewACL(allowedCidrs *[]string, enabled *bool) *ACL { +func NewACL(allowedCidrs ACLGetAllowedCidrsArgType, enabled ACLgetEnabledArgType) *ACL { this := ACL{} - this.AllowedCidrs = allowedCidrs - this.Enabled = enabled + setACLGetAllowedCidrsAttributeType(&this.AllowedCidrs, allowedCidrs) + setACLgetEnabledAttributeType(&this.Enabled, enabled) return &this } @@ -49,57 +89,47 @@ func NewACLWithDefaults() *ACL { } // GetAllowedCidrs returns the AllowedCidrs field value -func (o *ACL) GetAllowedCidrs() *[]string { - if o == nil || IsNil(o.AllowedCidrs) { - var ret *[]string - return ret - } - - return o.AllowedCidrs +func (o *ACL) GetAllowedCidrs() (ret ACLGetAllowedCidrsRetType) { + ret, _ = o.GetAllowedCidrsOk() + return ret } // GetAllowedCidrsOk returns a tuple with the AllowedCidrs field value // and a boolean to check if the value has been set. -func (o *ACL) GetAllowedCidrsOk() (*[]string, bool) { - if o == nil { - return nil, false - } - return o.AllowedCidrs, true +func (o *ACL) GetAllowedCidrsOk() (ret ACLGetAllowedCidrsRetType, ok bool) { + return getACLGetAllowedCidrsAttributeTypeOk(o.AllowedCidrs) } // SetAllowedCidrs sets field value -func (o *ACL) SetAllowedCidrs(v *[]string) { - o.AllowedCidrs = v +func (o *ACL) SetAllowedCidrs(v ACLGetAllowedCidrsRetType) { + setACLGetAllowedCidrsAttributeType(&o.AllowedCidrs, v) } // GetEnabled returns the Enabled field value -func (o *ACL) GetEnabled() *bool { - if o == nil || IsNil(o.Enabled) { - var ret *bool - return ret - } - - return o.Enabled +func (o *ACL) GetEnabled() (ret ACLgetEnabledRetType) { + ret, _ = o.GetEnabledOk() + return ret } // GetEnabledOk returns a tuple with the Enabled field value // and a boolean to check if the value has been set. -func (o *ACL) GetEnabledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.Enabled, true +func (o *ACL) GetEnabledOk() (ret ACLgetEnabledRetType, ok bool) { + return getACLgetEnabledAttributeTypeOk(o.Enabled) } // SetEnabled sets field value -func (o *ACL) SetEnabled(v *bool) { - o.Enabled = v +func (o *ACL) SetEnabled(v ACLgetEnabledRetType) { + setACLgetEnabledAttributeType(&o.Enabled, v) } func (o ACL) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["allowedCidrs"] = o.AllowedCidrs - toSerialize["enabled"] = o.Enabled + if val, ok := getACLGetAllowedCidrsAttributeTypeOk(o.AllowedCidrs); ok { + toSerialize["AllowedCidrs"] = val + } + if val, ok := getACLgetEnabledAttributeTypeOk(o.Enabled); ok { + toSerialize["Enabled"] = val + } return toSerialize, nil } diff --git a/services/ske/model_argus.go b/services/ske/model_argus.go index c54ba13cf..e36933a6a 100644 --- a/services/ske/model_argus.go +++ b/services/ske/model_argus.go @@ -17,14 +17,55 @@ import ( // checks if the Argus type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Argus{} +/* + types and functions for argusInstanceId +*/ + +// isNotNullableString +type ArgusGetArgusInstanceIdAttributeType = *string + +func getArgusGetArgusInstanceIdAttributeTypeOk(arg ArgusGetArgusInstanceIdAttributeType) (ret ArgusGetArgusInstanceIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setArgusGetArgusInstanceIdAttributeType(arg *ArgusGetArgusInstanceIdAttributeType, val ArgusGetArgusInstanceIdRetType) { + *arg = &val +} + +type ArgusGetArgusInstanceIdArgType = string +type ArgusGetArgusInstanceIdRetType = string + +/* + types and functions for enabled +*/ + +// isBoolean +type ArgusgetEnabledAttributeType = *bool +type ArgusgetEnabledArgType = bool +type ArgusgetEnabledRetType = bool + +func getArgusgetEnabledAttributeTypeOk(arg ArgusgetEnabledAttributeType) (ret ArgusgetEnabledRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setArgusgetEnabledAttributeType(arg *ArgusgetEnabledAttributeType, val ArgusgetEnabledRetType) { + *arg = &val +} + // Argus struct for Argus type Argus struct { // Argus instance ID to choose which Argus instance is used. // REQUIRED - ArgusInstanceId *string `json:"argusInstanceId"` + ArgusInstanceId ArgusGetArgusInstanceIdAttributeType `json:"argusInstanceId"` // Enables the argus extension. // REQUIRED - Enabled *bool `json:"enabled"` + Enabled ArgusgetEnabledAttributeType `json:"enabled"` } type _Argus Argus @@ -33,10 +74,10 @@ type _Argus Argus // 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 NewArgus(argusInstanceId *string, enabled *bool) *Argus { +func NewArgus(argusInstanceId ArgusGetArgusInstanceIdArgType, enabled ArgusgetEnabledArgType) *Argus { this := Argus{} - this.ArgusInstanceId = argusInstanceId - this.Enabled = enabled + setArgusGetArgusInstanceIdAttributeType(&this.ArgusInstanceId, argusInstanceId) + setArgusgetEnabledAttributeType(&this.Enabled, enabled) return &this } @@ -49,57 +90,47 @@ func NewArgusWithDefaults() *Argus { } // GetArgusInstanceId returns the ArgusInstanceId field value -func (o *Argus) GetArgusInstanceId() *string { - if o == nil || IsNil(o.ArgusInstanceId) { - var ret *string - return ret - } - - return o.ArgusInstanceId +func (o *Argus) GetArgusInstanceId() (ret ArgusGetArgusInstanceIdRetType) { + ret, _ = o.GetArgusInstanceIdOk() + return ret } // GetArgusInstanceIdOk returns a tuple with the ArgusInstanceId field value // and a boolean to check if the value has been set. -func (o *Argus) GetArgusInstanceIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ArgusInstanceId, true +func (o *Argus) GetArgusInstanceIdOk() (ret ArgusGetArgusInstanceIdRetType, ok bool) { + return getArgusGetArgusInstanceIdAttributeTypeOk(o.ArgusInstanceId) } // SetArgusInstanceId sets field value -func (o *Argus) SetArgusInstanceId(v *string) { - o.ArgusInstanceId = v +func (o *Argus) SetArgusInstanceId(v ArgusGetArgusInstanceIdRetType) { + setArgusGetArgusInstanceIdAttributeType(&o.ArgusInstanceId, v) } // GetEnabled returns the Enabled field value -func (o *Argus) GetEnabled() *bool { - if o == nil || IsNil(o.Enabled) { - var ret *bool - return ret - } - - return o.Enabled +func (o *Argus) GetEnabled() (ret ArgusgetEnabledRetType) { + ret, _ = o.GetEnabledOk() + return ret } // GetEnabledOk returns a tuple with the Enabled field value // and a boolean to check if the value has been set. -func (o *Argus) GetEnabledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.Enabled, true +func (o *Argus) GetEnabledOk() (ret ArgusgetEnabledRetType, ok bool) { + return getArgusgetEnabledAttributeTypeOk(o.Enabled) } // SetEnabled sets field value -func (o *Argus) SetEnabled(v *bool) { - o.Enabled = v +func (o *Argus) SetEnabled(v ArgusgetEnabledRetType) { + setArgusgetEnabledAttributeType(&o.Enabled, v) } func (o Argus) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["argusInstanceId"] = o.ArgusInstanceId - toSerialize["enabled"] = o.Enabled + if val, ok := getArgusGetArgusInstanceIdAttributeTypeOk(o.ArgusInstanceId); ok { + toSerialize["ArgusInstanceId"] = val + } + if val, ok := getArgusgetEnabledAttributeTypeOk(o.Enabled); ok { + toSerialize["Enabled"] = val + } return toSerialize, nil } diff --git a/services/ske/model_availability_zone.go b/services/ske/model_availability_zone.go index 44aab4893..c8e974479 100644 --- a/services/ske/model_availability_zone.go +++ b/services/ske/model_availability_zone.go @@ -17,9 +17,30 @@ import ( // checks if the AvailabilityZone type satisfies the MappedNullable interface at compile time var _ MappedNullable = &AvailabilityZone{} +/* + types and functions for name +*/ + +// isNotNullableString +type AvailabilityZoneGetNameAttributeType = *string + +func getAvailabilityZoneGetNameAttributeTypeOk(arg AvailabilityZoneGetNameAttributeType) (ret AvailabilityZoneGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setAvailabilityZoneGetNameAttributeType(arg *AvailabilityZoneGetNameAttributeType, val AvailabilityZoneGetNameRetType) { + *arg = &val +} + +type AvailabilityZoneGetNameArgType = string +type AvailabilityZoneGetNameRetType = string + // AvailabilityZone struct for AvailabilityZone type AvailabilityZone struct { - Name *string `json:"name,omitempty"` + Name AvailabilityZoneGetNameAttributeType `json:"name,omitempty"` } // NewAvailabilityZone instantiates a new AvailabilityZone object @@ -40,41 +61,32 @@ func NewAvailabilityZoneWithDefaults() *AvailabilityZone { } // GetName returns the Name field value if set, zero value otherwise. -func (o *AvailabilityZone) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *AvailabilityZone) GetName() (res AvailabilityZoneGetNameRetType) { + 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 *AvailabilityZone) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *AvailabilityZone) GetNameOk() (ret AvailabilityZoneGetNameRetType, ok bool) { + return getAvailabilityZoneGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *AvailabilityZone) 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 *AvailabilityZone) SetName(v *string) { - o.Name = v +func (o *AvailabilityZone) SetName(v AvailabilityZoneGetNameRetType) { + setAvailabilityZoneGetNameAttributeType(&o.Name, v) } func (o AvailabilityZone) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getAvailabilityZoneGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } return toSerialize, nil } diff --git a/services/ske/model_cluster.go b/services/ske/model_cluster.go index 23538cbb0..2a44a7d37 100644 --- a/services/ske/model_cluster.go +++ b/services/ske/model_cluster.go @@ -17,18 +17,179 @@ import ( // checks if the Cluster type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Cluster{} +/* + types and functions for extensions +*/ + +// isModel +type ClusterGetExtensionsAttributeType = *Extension +type ClusterGetExtensionsArgType = Extension +type ClusterGetExtensionsRetType = Extension + +func getClusterGetExtensionsAttributeTypeOk(arg ClusterGetExtensionsAttributeType) (ret ClusterGetExtensionsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setClusterGetExtensionsAttributeType(arg *ClusterGetExtensionsAttributeType, val ClusterGetExtensionsRetType) { + *arg = &val +} + +/* + types and functions for hibernation +*/ + +// isModel +type ClusterGetHibernationAttributeType = *Hibernation +type ClusterGetHibernationArgType = Hibernation +type ClusterGetHibernationRetType = Hibernation + +func getClusterGetHibernationAttributeTypeOk(arg ClusterGetHibernationAttributeType) (ret ClusterGetHibernationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setClusterGetHibernationAttributeType(arg *ClusterGetHibernationAttributeType, val ClusterGetHibernationRetType) { + *arg = &val +} + +/* + types and functions for kubernetes +*/ + +// isModel +type ClusterGetKubernetesAttributeType = *Kubernetes +type ClusterGetKubernetesArgType = Kubernetes +type ClusterGetKubernetesRetType = Kubernetes + +func getClusterGetKubernetesAttributeTypeOk(arg ClusterGetKubernetesAttributeType) (ret ClusterGetKubernetesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setClusterGetKubernetesAttributeType(arg *ClusterGetKubernetesAttributeType, val ClusterGetKubernetesRetType) { + *arg = &val +} + +/* + types and functions for maintenance +*/ + +// isModel +type ClusterGetMaintenanceAttributeType = *Maintenance +type ClusterGetMaintenanceArgType = Maintenance +type ClusterGetMaintenanceRetType = Maintenance + +func getClusterGetMaintenanceAttributeTypeOk(arg ClusterGetMaintenanceAttributeType) (ret ClusterGetMaintenanceRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setClusterGetMaintenanceAttributeType(arg *ClusterGetMaintenanceAttributeType, val ClusterGetMaintenanceRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type ClusterGetNameAttributeType = *string + +func getClusterGetNameAttributeTypeOk(arg ClusterGetNameAttributeType) (ret ClusterGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setClusterGetNameAttributeType(arg *ClusterGetNameAttributeType, val ClusterGetNameRetType) { + *arg = &val +} + +type ClusterGetNameArgType = string +type ClusterGetNameRetType = string + +/* + types and functions for network +*/ + +// isModel +type ClusterGetNetworkAttributeType = *Network +type ClusterGetNetworkArgType = Network +type ClusterGetNetworkRetType = Network + +func getClusterGetNetworkAttributeTypeOk(arg ClusterGetNetworkAttributeType) (ret ClusterGetNetworkRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setClusterGetNetworkAttributeType(arg *ClusterGetNetworkAttributeType, val ClusterGetNetworkRetType) { + *arg = &val +} + +/* + types and functions for nodepools +*/ + +// isArray +type ClusterGetNodepoolsAttributeType = *[]Nodepool +type ClusterGetNodepoolsArgType = []Nodepool +type ClusterGetNodepoolsRetType = []Nodepool + +func getClusterGetNodepoolsAttributeTypeOk(arg ClusterGetNodepoolsAttributeType) (ret ClusterGetNodepoolsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setClusterGetNodepoolsAttributeType(arg *ClusterGetNodepoolsAttributeType, val ClusterGetNodepoolsRetType) { + *arg = &val +} + +/* + types and functions for status +*/ + +// isModel +type ClusterGetStatusAttributeType = *ClusterStatus +type ClusterGetStatusArgType = ClusterStatus +type ClusterGetStatusRetType = ClusterStatus + +func getClusterGetStatusAttributeTypeOk(arg ClusterGetStatusAttributeType) (ret ClusterGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setClusterGetStatusAttributeType(arg *ClusterGetStatusAttributeType, val ClusterGetStatusRetType) { + *arg = &val +} + // Cluster struct for Cluster type Cluster struct { - Extensions *Extension `json:"extensions,omitempty"` - Hibernation *Hibernation `json:"hibernation,omitempty"` + Extensions ClusterGetExtensionsAttributeType `json:"extensions,omitempty"` + Hibernation ClusterGetHibernationAttributeType `json:"hibernation,omitempty"` // REQUIRED - Kubernetes *Kubernetes `json:"kubernetes"` - Maintenance *Maintenance `json:"maintenance,omitempty"` - Name *string `json:"name,omitempty"` - Network *Network `json:"network,omitempty"` + Kubernetes ClusterGetKubernetesAttributeType `json:"kubernetes"` + Maintenance ClusterGetMaintenanceAttributeType `json:"maintenance,omitempty"` + Name ClusterGetNameAttributeType `json:"name,omitempty"` + Network ClusterGetNetworkAttributeType `json:"network,omitempty"` // REQUIRED - Nodepools *[]Nodepool `json:"nodepools"` - Status *ClusterStatus `json:"status,omitempty"` + Nodepools ClusterGetNodepoolsAttributeType `json:"nodepools"` + Status ClusterGetStatusAttributeType `json:"status,omitempty"` } type _Cluster Cluster @@ -37,10 +198,10 @@ type _Cluster Cluster // 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 NewCluster(kubernetes *Kubernetes, nodepools *[]Nodepool) *Cluster { +func NewCluster(kubernetes ClusterGetKubernetesArgType, nodepools ClusterGetNodepoolsArgType) *Cluster { this := Cluster{} - this.Kubernetes = kubernetes - this.Nodepools = nodepools + setClusterGetKubernetesAttributeType(&this.Kubernetes, kubernetes) + setClusterGetNodepoolsAttributeType(&this.Nodepools, nodepools) return &this } @@ -53,266 +214,202 @@ func NewClusterWithDefaults() *Cluster { } // GetExtensions returns the Extensions field value if set, zero value otherwise. -func (o *Cluster) GetExtensions() *Extension { - if o == nil || IsNil(o.Extensions) { - var ret *Extension - return ret - } - return o.Extensions +func (o *Cluster) GetExtensions() (res ClusterGetExtensionsRetType) { + res, _ = o.GetExtensionsOk() + return } // GetExtensionsOk returns a tuple with the Extensions field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Cluster) GetExtensionsOk() (*Extension, bool) { - if o == nil || IsNil(o.Extensions) { - return nil, false - } - return o.Extensions, true +func (o *Cluster) GetExtensionsOk() (ret ClusterGetExtensionsRetType, ok bool) { + return getClusterGetExtensionsAttributeTypeOk(o.Extensions) } // HasExtensions returns a boolean if a field has been set. func (o *Cluster) HasExtensions() bool { - if o != nil && !IsNil(o.Extensions) { - return true - } - - return false + _, ok := o.GetExtensionsOk() + return ok } // SetExtensions gets a reference to the given Extension and assigns it to the Extensions field. -func (o *Cluster) SetExtensions(v *Extension) { - o.Extensions = v +func (o *Cluster) SetExtensions(v ClusterGetExtensionsRetType) { + setClusterGetExtensionsAttributeType(&o.Extensions, v) } // GetHibernation returns the Hibernation field value if set, zero value otherwise. -func (o *Cluster) GetHibernation() *Hibernation { - if o == nil || IsNil(o.Hibernation) { - var ret *Hibernation - return ret - } - return o.Hibernation +func (o *Cluster) GetHibernation() (res ClusterGetHibernationRetType) { + res, _ = o.GetHibernationOk() + return } // GetHibernationOk returns a tuple with the Hibernation field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Cluster) GetHibernationOk() (*Hibernation, bool) { - if o == nil || IsNil(o.Hibernation) { - return nil, false - } - return o.Hibernation, true +func (o *Cluster) GetHibernationOk() (ret ClusterGetHibernationRetType, ok bool) { + return getClusterGetHibernationAttributeTypeOk(o.Hibernation) } // HasHibernation returns a boolean if a field has been set. func (o *Cluster) HasHibernation() bool { - if o != nil && !IsNil(o.Hibernation) { - return true - } - - return false + _, ok := o.GetHibernationOk() + return ok } // SetHibernation gets a reference to the given Hibernation and assigns it to the Hibernation field. -func (o *Cluster) SetHibernation(v *Hibernation) { - o.Hibernation = v +func (o *Cluster) SetHibernation(v ClusterGetHibernationRetType) { + setClusterGetHibernationAttributeType(&o.Hibernation, v) } // GetKubernetes returns the Kubernetes field value -func (o *Cluster) GetKubernetes() *Kubernetes { - if o == nil || IsNil(o.Kubernetes) { - var ret *Kubernetes - return ret - } - - return o.Kubernetes +func (o *Cluster) GetKubernetes() (ret ClusterGetKubernetesRetType) { + ret, _ = o.GetKubernetesOk() + return ret } // GetKubernetesOk returns a tuple with the Kubernetes field value // and a boolean to check if the value has been set. -func (o *Cluster) GetKubernetesOk() (*Kubernetes, bool) { - if o == nil { - return nil, false - } - return o.Kubernetes, true +func (o *Cluster) GetKubernetesOk() (ret ClusterGetKubernetesRetType, ok bool) { + return getClusterGetKubernetesAttributeTypeOk(o.Kubernetes) } // SetKubernetes sets field value -func (o *Cluster) SetKubernetes(v *Kubernetes) { - o.Kubernetes = v +func (o *Cluster) SetKubernetes(v ClusterGetKubernetesRetType) { + setClusterGetKubernetesAttributeType(&o.Kubernetes, v) } // GetMaintenance returns the Maintenance field value if set, zero value otherwise. -func (o *Cluster) GetMaintenance() *Maintenance { - if o == nil || IsNil(o.Maintenance) { - var ret *Maintenance - return ret - } - return o.Maintenance +func (o *Cluster) GetMaintenance() (res ClusterGetMaintenanceRetType) { + res, _ = o.GetMaintenanceOk() + return } // GetMaintenanceOk returns a tuple with the Maintenance field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Cluster) GetMaintenanceOk() (*Maintenance, bool) { - if o == nil || IsNil(o.Maintenance) { - return nil, false - } - return o.Maintenance, true +func (o *Cluster) GetMaintenanceOk() (ret ClusterGetMaintenanceRetType, ok bool) { + return getClusterGetMaintenanceAttributeTypeOk(o.Maintenance) } // HasMaintenance returns a boolean if a field has been set. func (o *Cluster) HasMaintenance() bool { - if o != nil && !IsNil(o.Maintenance) { - return true - } - - return false + _, ok := o.GetMaintenanceOk() + return ok } // SetMaintenance gets a reference to the given Maintenance and assigns it to the Maintenance field. -func (o *Cluster) SetMaintenance(v *Maintenance) { - o.Maintenance = v +func (o *Cluster) SetMaintenance(v ClusterGetMaintenanceRetType) { + setClusterGetMaintenanceAttributeType(&o.Maintenance, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *Cluster) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *Cluster) GetName() (res ClusterGetNameRetType) { + 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 *Cluster) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *Cluster) GetNameOk() (ret ClusterGetNameRetType, ok bool) { + return getClusterGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *Cluster) 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 *Cluster) SetName(v *string) { - o.Name = v +func (o *Cluster) SetName(v ClusterGetNameRetType) { + setClusterGetNameAttributeType(&o.Name, v) } // GetNetwork returns the Network field value if set, zero value otherwise. -func (o *Cluster) GetNetwork() *Network { - if o == nil || IsNil(o.Network) { - var ret *Network - return ret - } - return o.Network +func (o *Cluster) GetNetwork() (res ClusterGetNetworkRetType) { + res, _ = o.GetNetworkOk() + return } // GetNetworkOk returns a tuple with the Network field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Cluster) GetNetworkOk() (*Network, bool) { - if o == nil || IsNil(o.Network) { - return nil, false - } - return o.Network, true +func (o *Cluster) GetNetworkOk() (ret ClusterGetNetworkRetType, ok bool) { + return getClusterGetNetworkAttributeTypeOk(o.Network) } // HasNetwork returns a boolean if a field has been set. func (o *Cluster) HasNetwork() bool { - if o != nil && !IsNil(o.Network) { - return true - } - - return false + _, ok := o.GetNetworkOk() + return ok } // SetNetwork gets a reference to the given Network and assigns it to the Network field. -func (o *Cluster) SetNetwork(v *Network) { - o.Network = v +func (o *Cluster) SetNetwork(v ClusterGetNetworkRetType) { + setClusterGetNetworkAttributeType(&o.Network, v) } // GetNodepools returns the Nodepools field value -func (o *Cluster) GetNodepools() *[]Nodepool { - if o == nil || IsNil(o.Nodepools) { - var ret *[]Nodepool - return ret - } - - return o.Nodepools +func (o *Cluster) GetNodepools() (ret ClusterGetNodepoolsRetType) { + ret, _ = o.GetNodepoolsOk() + return ret } // GetNodepoolsOk returns a tuple with the Nodepools field value // and a boolean to check if the value has been set. -func (o *Cluster) GetNodepoolsOk() (*[]Nodepool, bool) { - if o == nil { - return nil, false - } - return o.Nodepools, true +func (o *Cluster) GetNodepoolsOk() (ret ClusterGetNodepoolsRetType, ok bool) { + return getClusterGetNodepoolsAttributeTypeOk(o.Nodepools) } // SetNodepools sets field value -func (o *Cluster) SetNodepools(v *[]Nodepool) { - o.Nodepools = v +func (o *Cluster) SetNodepools(v ClusterGetNodepoolsRetType) { + setClusterGetNodepoolsAttributeType(&o.Nodepools, v) } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *Cluster) GetStatus() *ClusterStatus { - if o == nil || IsNil(o.Status) { - var ret *ClusterStatus - return ret - } - return o.Status +func (o *Cluster) GetStatus() (res ClusterGetStatusRetType) { + 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 *Cluster) GetStatusOk() (*ClusterStatus, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true +func (o *Cluster) GetStatusOk() (ret ClusterGetStatusRetType, ok bool) { + return getClusterGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. func (o *Cluster) HasStatus() bool { - if o != nil && !IsNil(o.Status) { - return true - } - - return false + _, ok := o.GetStatusOk() + return ok } // SetStatus gets a reference to the given ClusterStatus and assigns it to the Status field. -func (o *Cluster) SetStatus(v *ClusterStatus) { - o.Status = v +func (o *Cluster) SetStatus(v ClusterGetStatusRetType) { + setClusterGetStatusAttributeType(&o.Status, v) } func (o Cluster) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Extensions) { - toSerialize["extensions"] = o.Extensions + if val, ok := getClusterGetExtensionsAttributeTypeOk(o.Extensions); ok { + toSerialize["Extensions"] = val + } + if val, ok := getClusterGetHibernationAttributeTypeOk(o.Hibernation); ok { + toSerialize["Hibernation"] = val + } + if val, ok := getClusterGetKubernetesAttributeTypeOk(o.Kubernetes); ok { + toSerialize["Kubernetes"] = val } - if !IsNil(o.Hibernation) { - toSerialize["hibernation"] = o.Hibernation + if val, ok := getClusterGetMaintenanceAttributeTypeOk(o.Maintenance); ok { + toSerialize["Maintenance"] = val } - toSerialize["kubernetes"] = o.Kubernetes - if !IsNil(o.Maintenance) { - toSerialize["maintenance"] = o.Maintenance + if val, ok := getClusterGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getClusterGetNetworkAttributeTypeOk(o.Network); ok { + toSerialize["Network"] = val } - if !IsNil(o.Network) { - toSerialize["network"] = o.Network + if val, ok := getClusterGetNodepoolsAttributeTypeOk(o.Nodepools); ok { + toSerialize["Nodepools"] = val } - toSerialize["nodepools"] = o.Nodepools - if !IsNil(o.Status) { - toSerialize["status"] = o.Status + if val, ok := getClusterGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } return toSerialize, nil } diff --git a/services/ske/model_cluster_status.go b/services/ske/model_cluster_status.go index 8512eb376..18638528d 100644 --- a/services/ske/model_cluster_status.go +++ b/services/ske/model_cluster_status.go @@ -18,16 +18,136 @@ import ( // checks if the ClusterStatus type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ClusterStatus{} +/* + types and functions for aggregated +*/ + +// isEnumRef +type ClusterStatusGetAggregatedAttributeType = *ClusterStatusState +type ClusterStatusGetAggregatedArgType = ClusterStatusState +type ClusterStatusGetAggregatedRetType = ClusterStatusState + +func getClusterStatusGetAggregatedAttributeTypeOk(arg ClusterStatusGetAggregatedAttributeType) (ret ClusterStatusGetAggregatedRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setClusterStatusGetAggregatedAttributeType(arg *ClusterStatusGetAggregatedAttributeType, val ClusterStatusGetAggregatedRetType) { + *arg = &val +} + +/* + types and functions for creationTime +*/ + +// isDateTime +type ClusterStatusGetCreationTimeAttributeType = *time.Time +type ClusterStatusGetCreationTimeArgType = time.Time +type ClusterStatusGetCreationTimeRetType = time.Time + +func getClusterStatusGetCreationTimeAttributeTypeOk(arg ClusterStatusGetCreationTimeAttributeType) (ret ClusterStatusGetCreationTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setClusterStatusGetCreationTimeAttributeType(arg *ClusterStatusGetCreationTimeAttributeType, val ClusterStatusGetCreationTimeRetType) { + *arg = &val +} + +/* + types and functions for credentialsRotation +*/ + +// isModel +type ClusterStatusGetCredentialsRotationAttributeType = *CredentialsRotationState +type ClusterStatusGetCredentialsRotationArgType = CredentialsRotationState +type ClusterStatusGetCredentialsRotationRetType = CredentialsRotationState + +func getClusterStatusGetCredentialsRotationAttributeTypeOk(arg ClusterStatusGetCredentialsRotationAttributeType) (ret ClusterStatusGetCredentialsRotationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setClusterStatusGetCredentialsRotationAttributeType(arg *ClusterStatusGetCredentialsRotationAttributeType, val ClusterStatusGetCredentialsRotationRetType) { + *arg = &val +} + +/* + types and functions for egressAddressRanges +*/ + +// isArray +type ClusterStatusGetEgressAddressRangesAttributeType = *[]string +type ClusterStatusGetEgressAddressRangesArgType = []string +type ClusterStatusGetEgressAddressRangesRetType = []string + +func getClusterStatusGetEgressAddressRangesAttributeTypeOk(arg ClusterStatusGetEgressAddressRangesAttributeType) (ret ClusterStatusGetEgressAddressRangesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setClusterStatusGetEgressAddressRangesAttributeType(arg *ClusterStatusGetEgressAddressRangesAttributeType, val ClusterStatusGetEgressAddressRangesRetType) { + *arg = &val +} + +/* + types and functions for error +*/ + +// isModel +type ClusterStatusGetErrorAttributeType = *RuntimeError +type ClusterStatusGetErrorArgType = RuntimeError +type ClusterStatusGetErrorRetType = RuntimeError + +func getClusterStatusGetErrorAttributeTypeOk(arg ClusterStatusGetErrorAttributeType) (ret ClusterStatusGetErrorRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setClusterStatusGetErrorAttributeType(arg *ClusterStatusGetErrorAttributeType, val ClusterStatusGetErrorRetType) { + *arg = &val +} + +/* + types and functions for hibernated +*/ + +// isBoolean +type ClusterStatusgetHibernatedAttributeType = *bool +type ClusterStatusgetHibernatedArgType = bool +type ClusterStatusgetHibernatedRetType = bool + +func getClusterStatusgetHibernatedAttributeTypeOk(arg ClusterStatusgetHibernatedAttributeType) (ret ClusterStatusgetHibernatedRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setClusterStatusgetHibernatedAttributeType(arg *ClusterStatusgetHibernatedAttributeType, val ClusterStatusgetHibernatedRetType) { + *arg = &val +} + // ClusterStatus struct for ClusterStatus type ClusterStatus struct { - Aggregated *ClusterStatusState `json:"aggregated,omitempty"` + Aggregated ClusterStatusGetAggregatedAttributeType `json:"aggregated,omitempty"` // Format: `2024-02-15T11:06:29Z` - CreationTime *time.Time `json:"creationTime,omitempty"` - CredentialsRotation *CredentialsRotationState `json:"credentialsRotation,omitempty"` + CreationTime ClusterStatusGetCreationTimeAttributeType `json:"creationTime,omitempty"` + CredentialsRotation ClusterStatusGetCredentialsRotationAttributeType `json:"credentialsRotation,omitempty"` // The outgoing network ranges (in CIDR notation) of traffic originating from workload on the cluster. - EgressAddressRanges *[]string `json:"egressAddressRanges,omitempty"` - Error *RuntimeError `json:"error,omitempty"` - Hibernated *bool `json:"hibernated,omitempty"` + EgressAddressRanges ClusterStatusGetEgressAddressRangesAttributeType `json:"egressAddressRanges,omitempty"` + Error ClusterStatusGetErrorAttributeType `json:"error,omitempty"` + Hibernated ClusterStatusgetHibernatedAttributeType `json:"hibernated,omitempty"` } // NewClusterStatus instantiates a new ClusterStatus object @@ -36,8 +156,6 @@ type ClusterStatus struct { // will change when the set of required properties is changed func NewClusterStatus() *ClusterStatus { this := ClusterStatus{} - var aggregated ClusterStatusState = CLUSTERSTATUSSTATE_UNSPECIFIED - this.Aggregated = &aggregated return &this } @@ -52,216 +170,162 @@ func NewClusterStatusWithDefaults() *ClusterStatus { } // GetAggregated returns the Aggregated field value if set, zero value otherwise. -func (o *ClusterStatus) GetAggregated() *ClusterStatusState { - if o == nil || IsNil(o.Aggregated) { - var ret *ClusterStatusState - return ret - } - return o.Aggregated +func (o *ClusterStatus) GetAggregated() (res ClusterStatusGetAggregatedRetType) { + res, _ = o.GetAggregatedOk() + return } // GetAggregatedOk returns a tuple with the Aggregated field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClusterStatus) GetAggregatedOk() (*ClusterStatusState, bool) { - if o == nil || IsNil(o.Aggregated) { - return nil, false - } - return o.Aggregated, true +func (o *ClusterStatus) GetAggregatedOk() (ret ClusterStatusGetAggregatedRetType, ok bool) { + return getClusterStatusGetAggregatedAttributeTypeOk(o.Aggregated) } // HasAggregated returns a boolean if a field has been set. func (o *ClusterStatus) HasAggregated() bool { - if o != nil && !IsNil(o.Aggregated) { - return true - } - - return false + _, ok := o.GetAggregatedOk() + return ok } // SetAggregated gets a reference to the given ClusterStatusState and assigns it to the Aggregated field. -func (o *ClusterStatus) SetAggregated(v *ClusterStatusState) { - o.Aggregated = v +func (o *ClusterStatus) SetAggregated(v ClusterStatusGetAggregatedRetType) { + setClusterStatusGetAggregatedAttributeType(&o.Aggregated, v) } // GetCreationTime returns the CreationTime field value if set, zero value otherwise. -func (o *ClusterStatus) GetCreationTime() *time.Time { - if o == nil || IsNil(o.CreationTime) { - var ret *time.Time - return ret - } - return o.CreationTime +func (o *ClusterStatus) GetCreationTime() (res ClusterStatusGetCreationTimeRetType) { + res, _ = o.GetCreationTimeOk() + return } // GetCreationTimeOk returns a tuple with the CreationTime field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClusterStatus) GetCreationTimeOk() (*time.Time, bool) { - if o == nil || IsNil(o.CreationTime) { - return nil, false - } - return o.CreationTime, true +func (o *ClusterStatus) GetCreationTimeOk() (ret ClusterStatusGetCreationTimeRetType, ok bool) { + return getClusterStatusGetCreationTimeAttributeTypeOk(o.CreationTime) } // HasCreationTime returns a boolean if a field has been set. func (o *ClusterStatus) HasCreationTime() bool { - if o != nil && !IsNil(o.CreationTime) { - return true - } - - return false + _, ok := o.GetCreationTimeOk() + return ok } // SetCreationTime gets a reference to the given time.Time and assigns it to the CreationTime field. -func (o *ClusterStatus) SetCreationTime(v *time.Time) { - o.CreationTime = v +func (o *ClusterStatus) SetCreationTime(v ClusterStatusGetCreationTimeRetType) { + setClusterStatusGetCreationTimeAttributeType(&o.CreationTime, v) } // GetCredentialsRotation returns the CredentialsRotation field value if set, zero value otherwise. -func (o *ClusterStatus) GetCredentialsRotation() *CredentialsRotationState { - if o == nil || IsNil(o.CredentialsRotation) { - var ret *CredentialsRotationState - return ret - } - return o.CredentialsRotation +func (o *ClusterStatus) GetCredentialsRotation() (res ClusterStatusGetCredentialsRotationRetType) { + res, _ = o.GetCredentialsRotationOk() + return } // GetCredentialsRotationOk returns a tuple with the CredentialsRotation field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClusterStatus) GetCredentialsRotationOk() (*CredentialsRotationState, bool) { - if o == nil || IsNil(o.CredentialsRotation) { - return nil, false - } - return o.CredentialsRotation, true +func (o *ClusterStatus) GetCredentialsRotationOk() (ret ClusterStatusGetCredentialsRotationRetType, ok bool) { + return getClusterStatusGetCredentialsRotationAttributeTypeOk(o.CredentialsRotation) } // HasCredentialsRotation returns a boolean if a field has been set. func (o *ClusterStatus) HasCredentialsRotation() bool { - if o != nil && !IsNil(o.CredentialsRotation) { - return true - } - - return false + _, ok := o.GetCredentialsRotationOk() + return ok } // SetCredentialsRotation gets a reference to the given CredentialsRotationState and assigns it to the CredentialsRotation field. -func (o *ClusterStatus) SetCredentialsRotation(v *CredentialsRotationState) { - o.CredentialsRotation = v +func (o *ClusterStatus) SetCredentialsRotation(v ClusterStatusGetCredentialsRotationRetType) { + setClusterStatusGetCredentialsRotationAttributeType(&o.CredentialsRotation, v) } // GetEgressAddressRanges returns the EgressAddressRanges field value if set, zero value otherwise. -func (o *ClusterStatus) GetEgressAddressRanges() *[]string { - if o == nil || IsNil(o.EgressAddressRanges) { - var ret *[]string - return ret - } - return o.EgressAddressRanges +func (o *ClusterStatus) GetEgressAddressRanges() (res ClusterStatusGetEgressAddressRangesRetType) { + res, _ = o.GetEgressAddressRangesOk() + return } // GetEgressAddressRangesOk returns a tuple with the EgressAddressRanges field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClusterStatus) GetEgressAddressRangesOk() (*[]string, bool) { - if o == nil || IsNil(o.EgressAddressRanges) { - return nil, false - } - return o.EgressAddressRanges, true +func (o *ClusterStatus) GetEgressAddressRangesOk() (ret ClusterStatusGetEgressAddressRangesRetType, ok bool) { + return getClusterStatusGetEgressAddressRangesAttributeTypeOk(o.EgressAddressRanges) } // HasEgressAddressRanges returns a boolean if a field has been set. func (o *ClusterStatus) HasEgressAddressRanges() bool { - if o != nil && !IsNil(o.EgressAddressRanges) { - return true - } - - return false + _, ok := o.GetEgressAddressRangesOk() + return ok } // SetEgressAddressRanges gets a reference to the given []string and assigns it to the EgressAddressRanges field. -func (o *ClusterStatus) SetEgressAddressRanges(v *[]string) { - o.EgressAddressRanges = v +func (o *ClusterStatus) SetEgressAddressRanges(v ClusterStatusGetEgressAddressRangesRetType) { + setClusterStatusGetEgressAddressRangesAttributeType(&o.EgressAddressRanges, v) } // GetError returns the Error field value if set, zero value otherwise. -func (o *ClusterStatus) GetError() *RuntimeError { - if o == nil || IsNil(o.Error) { - var ret *RuntimeError - return ret - } - return o.Error +func (o *ClusterStatus) GetError() (res ClusterStatusGetErrorRetType) { + res, _ = o.GetErrorOk() + return } // GetErrorOk returns a tuple with the Error field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClusterStatus) GetErrorOk() (*RuntimeError, bool) { - if o == nil || IsNil(o.Error) { - return nil, false - } - return o.Error, true +func (o *ClusterStatus) GetErrorOk() (ret ClusterStatusGetErrorRetType, ok bool) { + return getClusterStatusGetErrorAttributeTypeOk(o.Error) } // HasError returns a boolean if a field has been set. func (o *ClusterStatus) HasError() bool { - if o != nil && !IsNil(o.Error) { - return true - } - - return false + _, ok := o.GetErrorOk() + return ok } // SetError gets a reference to the given RuntimeError and assigns it to the Error field. -func (o *ClusterStatus) SetError(v *RuntimeError) { - o.Error = v +func (o *ClusterStatus) SetError(v ClusterStatusGetErrorRetType) { + setClusterStatusGetErrorAttributeType(&o.Error, v) } // GetHibernated returns the Hibernated field value if set, zero value otherwise. -func (o *ClusterStatus) GetHibernated() *bool { - if o == nil || IsNil(o.Hibernated) { - var ret *bool - return ret - } - return o.Hibernated +func (o *ClusterStatus) GetHibernated() (res ClusterStatusgetHibernatedRetType) { + res, _ = o.GetHibernatedOk() + return } // GetHibernatedOk returns a tuple with the Hibernated field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClusterStatus) GetHibernatedOk() (*bool, bool) { - if o == nil || IsNil(o.Hibernated) { - return nil, false - } - return o.Hibernated, true +func (o *ClusterStatus) GetHibernatedOk() (ret ClusterStatusgetHibernatedRetType, ok bool) { + return getClusterStatusgetHibernatedAttributeTypeOk(o.Hibernated) } // HasHibernated returns a boolean if a field has been set. func (o *ClusterStatus) HasHibernated() bool { - if o != nil && !IsNil(o.Hibernated) { - return true - } - - return false + _, ok := o.GetHibernatedOk() + return ok } // SetHibernated gets a reference to the given bool and assigns it to the Hibernated field. -func (o *ClusterStatus) SetHibernated(v *bool) { - o.Hibernated = v +func (o *ClusterStatus) SetHibernated(v ClusterStatusgetHibernatedRetType) { + setClusterStatusgetHibernatedAttributeType(&o.Hibernated, v) } func (o ClusterStatus) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Aggregated) { - toSerialize["aggregated"] = o.Aggregated + if val, ok := getClusterStatusGetAggregatedAttributeTypeOk(o.Aggregated); ok { + toSerialize["Aggregated"] = val } - if !IsNil(o.CreationTime) { - toSerialize["creationTime"] = o.CreationTime + if val, ok := getClusterStatusGetCreationTimeAttributeTypeOk(o.CreationTime); ok { + toSerialize["CreationTime"] = val } - if !IsNil(o.CredentialsRotation) { - toSerialize["credentialsRotation"] = o.CredentialsRotation + if val, ok := getClusterStatusGetCredentialsRotationAttributeTypeOk(o.CredentialsRotation); ok { + toSerialize["CredentialsRotation"] = val } - if !IsNil(o.EgressAddressRanges) { - toSerialize["egressAddressRanges"] = o.EgressAddressRanges + if val, ok := getClusterStatusGetEgressAddressRangesAttributeTypeOk(o.EgressAddressRanges); ok { + toSerialize["EgressAddressRanges"] = val } - if !IsNil(o.Error) { - toSerialize["error"] = o.Error + if val, ok := getClusterStatusGetErrorAttributeTypeOk(o.Error); ok { + toSerialize["Error"] = val } - if !IsNil(o.Hibernated) { - toSerialize["hibernated"] = o.Hibernated + if val, ok := getClusterStatusgetHibernatedAttributeTypeOk(o.Hibernated); ok { + toSerialize["Hibernated"] = val } return toSerialize, nil } diff --git a/services/ske/model_create_kubeconfig_payload.go b/services/ske/model_create_kubeconfig_payload.go index 7af3b81a0..2a7db83bb 100644 --- a/services/ske/model_create_kubeconfig_payload.go +++ b/services/ske/model_create_kubeconfig_payload.go @@ -17,9 +17,30 @@ import ( // checks if the CreateKubeconfigPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateKubeconfigPayload{} +/* + types and functions for expirationSeconds +*/ + +// isNotNullableString +type CreateKubeconfigPayloadGetExpirationSecondsAttributeType = *string + +func getCreateKubeconfigPayloadGetExpirationSecondsAttributeTypeOk(arg CreateKubeconfigPayloadGetExpirationSecondsAttributeType) (ret CreateKubeconfigPayloadGetExpirationSecondsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateKubeconfigPayloadGetExpirationSecondsAttributeType(arg *CreateKubeconfigPayloadGetExpirationSecondsAttributeType, val CreateKubeconfigPayloadGetExpirationSecondsRetType) { + *arg = &val +} + +type CreateKubeconfigPayloadGetExpirationSecondsArgType = string +type CreateKubeconfigPayloadGetExpirationSecondsRetType = string + // CreateKubeconfigPayload struct for CreateKubeconfigPayload type CreateKubeconfigPayload struct { - ExpirationSeconds *string `json:"expirationSeconds,omitempty"` + ExpirationSeconds CreateKubeconfigPayloadGetExpirationSecondsAttributeType `json:"expirationSeconds,omitempty"` } // NewCreateKubeconfigPayload instantiates a new CreateKubeconfigPayload object @@ -40,41 +61,32 @@ func NewCreateKubeconfigPayloadWithDefaults() *CreateKubeconfigPayload { } // GetExpirationSeconds returns the ExpirationSeconds field value if set, zero value otherwise. -func (o *CreateKubeconfigPayload) GetExpirationSeconds() *string { - if o == nil || IsNil(o.ExpirationSeconds) { - var ret *string - return ret - } - return o.ExpirationSeconds +func (o *CreateKubeconfigPayload) GetExpirationSeconds() (res CreateKubeconfigPayloadGetExpirationSecondsRetType) { + res, _ = o.GetExpirationSecondsOk() + return } // GetExpirationSecondsOk returns a tuple with the ExpirationSeconds field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateKubeconfigPayload) GetExpirationSecondsOk() (*string, bool) { - if o == nil || IsNil(o.ExpirationSeconds) { - return nil, false - } - return o.ExpirationSeconds, true +func (o *CreateKubeconfigPayload) GetExpirationSecondsOk() (ret CreateKubeconfigPayloadGetExpirationSecondsRetType, ok bool) { + return getCreateKubeconfigPayloadGetExpirationSecondsAttributeTypeOk(o.ExpirationSeconds) } // HasExpirationSeconds returns a boolean if a field has been set. func (o *CreateKubeconfigPayload) HasExpirationSeconds() bool { - if o != nil && !IsNil(o.ExpirationSeconds) { - return true - } - - return false + _, ok := o.GetExpirationSecondsOk() + return ok } // SetExpirationSeconds gets a reference to the given string and assigns it to the ExpirationSeconds field. -func (o *CreateKubeconfigPayload) SetExpirationSeconds(v *string) { - o.ExpirationSeconds = v +func (o *CreateKubeconfigPayload) SetExpirationSeconds(v CreateKubeconfigPayloadGetExpirationSecondsRetType) { + setCreateKubeconfigPayloadGetExpirationSecondsAttributeType(&o.ExpirationSeconds, v) } func (o CreateKubeconfigPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.ExpirationSeconds) { - toSerialize["expirationSeconds"] = o.ExpirationSeconds + if val, ok := getCreateKubeconfigPayloadGetExpirationSecondsAttributeTypeOk(o.ExpirationSeconds); ok { + toSerialize["ExpirationSeconds"] = val } return toSerialize, nil } diff --git a/services/ske/model_create_or_update_cluster_payload.go b/services/ske/model_create_or_update_cluster_payload.go index 2e64551a0..48bea07f7 100644 --- a/services/ske/model_create_or_update_cluster_payload.go +++ b/services/ske/model_create_or_update_cluster_payload.go @@ -17,17 +17,157 @@ import ( // checks if the CreateOrUpdateClusterPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateOrUpdateClusterPayload{} +/* + types and functions for extensions +*/ + +// isModel +type CreateOrUpdateClusterPayloadGetExtensionsAttributeType = *Extension +type CreateOrUpdateClusterPayloadGetExtensionsArgType = Extension +type CreateOrUpdateClusterPayloadGetExtensionsRetType = Extension + +func getCreateOrUpdateClusterPayloadGetExtensionsAttributeTypeOk(arg CreateOrUpdateClusterPayloadGetExtensionsAttributeType) (ret CreateOrUpdateClusterPayloadGetExtensionsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateOrUpdateClusterPayloadGetExtensionsAttributeType(arg *CreateOrUpdateClusterPayloadGetExtensionsAttributeType, val CreateOrUpdateClusterPayloadGetExtensionsRetType) { + *arg = &val +} + +/* + types and functions for hibernation +*/ + +// isModel +type CreateOrUpdateClusterPayloadGetHibernationAttributeType = *Hibernation +type CreateOrUpdateClusterPayloadGetHibernationArgType = Hibernation +type CreateOrUpdateClusterPayloadGetHibernationRetType = Hibernation + +func getCreateOrUpdateClusterPayloadGetHibernationAttributeTypeOk(arg CreateOrUpdateClusterPayloadGetHibernationAttributeType) (ret CreateOrUpdateClusterPayloadGetHibernationRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateOrUpdateClusterPayloadGetHibernationAttributeType(arg *CreateOrUpdateClusterPayloadGetHibernationAttributeType, val CreateOrUpdateClusterPayloadGetHibernationRetType) { + *arg = &val +} + +/* + types and functions for kubernetes +*/ + +// isModel +type CreateOrUpdateClusterPayloadGetKubernetesAttributeType = *Kubernetes +type CreateOrUpdateClusterPayloadGetKubernetesArgType = Kubernetes +type CreateOrUpdateClusterPayloadGetKubernetesRetType = Kubernetes + +func getCreateOrUpdateClusterPayloadGetKubernetesAttributeTypeOk(arg CreateOrUpdateClusterPayloadGetKubernetesAttributeType) (ret CreateOrUpdateClusterPayloadGetKubernetesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateOrUpdateClusterPayloadGetKubernetesAttributeType(arg *CreateOrUpdateClusterPayloadGetKubernetesAttributeType, val CreateOrUpdateClusterPayloadGetKubernetesRetType) { + *arg = &val +} + +/* + types and functions for maintenance +*/ + +// isModel +type CreateOrUpdateClusterPayloadGetMaintenanceAttributeType = *Maintenance +type CreateOrUpdateClusterPayloadGetMaintenanceArgType = Maintenance +type CreateOrUpdateClusterPayloadGetMaintenanceRetType = Maintenance + +func getCreateOrUpdateClusterPayloadGetMaintenanceAttributeTypeOk(arg CreateOrUpdateClusterPayloadGetMaintenanceAttributeType) (ret CreateOrUpdateClusterPayloadGetMaintenanceRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateOrUpdateClusterPayloadGetMaintenanceAttributeType(arg *CreateOrUpdateClusterPayloadGetMaintenanceAttributeType, val CreateOrUpdateClusterPayloadGetMaintenanceRetType) { + *arg = &val +} + +/* + types and functions for network +*/ + +// isModel +type CreateOrUpdateClusterPayloadGetNetworkAttributeType = *Network +type CreateOrUpdateClusterPayloadGetNetworkArgType = Network +type CreateOrUpdateClusterPayloadGetNetworkRetType = Network + +func getCreateOrUpdateClusterPayloadGetNetworkAttributeTypeOk(arg CreateOrUpdateClusterPayloadGetNetworkAttributeType) (ret CreateOrUpdateClusterPayloadGetNetworkRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateOrUpdateClusterPayloadGetNetworkAttributeType(arg *CreateOrUpdateClusterPayloadGetNetworkAttributeType, val CreateOrUpdateClusterPayloadGetNetworkRetType) { + *arg = &val +} + +/* + types and functions for nodepools +*/ + +// isArray +type CreateOrUpdateClusterPayloadGetNodepoolsAttributeType = *[]Nodepool +type CreateOrUpdateClusterPayloadGetNodepoolsArgType = []Nodepool +type CreateOrUpdateClusterPayloadGetNodepoolsRetType = []Nodepool + +func getCreateOrUpdateClusterPayloadGetNodepoolsAttributeTypeOk(arg CreateOrUpdateClusterPayloadGetNodepoolsAttributeType) (ret CreateOrUpdateClusterPayloadGetNodepoolsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateOrUpdateClusterPayloadGetNodepoolsAttributeType(arg *CreateOrUpdateClusterPayloadGetNodepoolsAttributeType, val CreateOrUpdateClusterPayloadGetNodepoolsRetType) { + *arg = &val +} + +/* + types and functions for status +*/ + +// isModel +type CreateOrUpdateClusterPayloadGetStatusAttributeType = *ClusterStatus +type CreateOrUpdateClusterPayloadGetStatusArgType = ClusterStatus +type CreateOrUpdateClusterPayloadGetStatusRetType = ClusterStatus + +func getCreateOrUpdateClusterPayloadGetStatusAttributeTypeOk(arg CreateOrUpdateClusterPayloadGetStatusAttributeType) (ret CreateOrUpdateClusterPayloadGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateOrUpdateClusterPayloadGetStatusAttributeType(arg *CreateOrUpdateClusterPayloadGetStatusAttributeType, val CreateOrUpdateClusterPayloadGetStatusRetType) { + *arg = &val +} + // CreateOrUpdateClusterPayload struct for CreateOrUpdateClusterPayload type CreateOrUpdateClusterPayload struct { - Extensions *Extension `json:"extensions,omitempty"` - Hibernation *Hibernation `json:"hibernation,omitempty"` + Extensions CreateOrUpdateClusterPayloadGetExtensionsAttributeType `json:"extensions,omitempty"` + Hibernation CreateOrUpdateClusterPayloadGetHibernationAttributeType `json:"hibernation,omitempty"` // REQUIRED - Kubernetes *Kubernetes `json:"kubernetes"` - Maintenance *Maintenance `json:"maintenance,omitempty"` - Network *Network `json:"network,omitempty"` + Kubernetes CreateOrUpdateClusterPayloadGetKubernetesAttributeType `json:"kubernetes"` + Maintenance CreateOrUpdateClusterPayloadGetMaintenanceAttributeType `json:"maintenance,omitempty"` + Network CreateOrUpdateClusterPayloadGetNetworkAttributeType `json:"network,omitempty"` // REQUIRED - Nodepools *[]Nodepool `json:"nodepools"` - Status *ClusterStatus `json:"status,omitempty"` + Nodepools CreateOrUpdateClusterPayloadGetNodepoolsAttributeType `json:"nodepools"` + Status CreateOrUpdateClusterPayloadGetStatusAttributeType `json:"status,omitempty"` } type _CreateOrUpdateClusterPayload CreateOrUpdateClusterPayload @@ -36,10 +176,10 @@ type _CreateOrUpdateClusterPayload CreateOrUpdateClusterPayload // 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 NewCreateOrUpdateClusterPayload(kubernetes *Kubernetes, nodepools *[]Nodepool) *CreateOrUpdateClusterPayload { +func NewCreateOrUpdateClusterPayload(kubernetes CreateOrUpdateClusterPayloadGetKubernetesArgType, nodepools CreateOrUpdateClusterPayloadGetNodepoolsArgType) *CreateOrUpdateClusterPayload { this := CreateOrUpdateClusterPayload{} - this.Kubernetes = kubernetes - this.Nodepools = nodepools + setCreateOrUpdateClusterPayloadGetKubernetesAttributeType(&this.Kubernetes, kubernetes) + setCreateOrUpdateClusterPayloadGetNodepoolsAttributeType(&this.Nodepools, nodepools) return &this } @@ -52,231 +192,176 @@ func NewCreateOrUpdateClusterPayloadWithDefaults() *CreateOrUpdateClusterPayload } // GetExtensions returns the Extensions field value if set, zero value otherwise. -func (o *CreateOrUpdateClusterPayload) GetExtensions() *Extension { - if o == nil || IsNil(o.Extensions) { - var ret *Extension - return ret - } - return o.Extensions +func (o *CreateOrUpdateClusterPayload) GetExtensions() (res CreateOrUpdateClusterPayloadGetExtensionsRetType) { + res, _ = o.GetExtensionsOk() + return } // GetExtensionsOk returns a tuple with the Extensions field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateOrUpdateClusterPayload) GetExtensionsOk() (*Extension, bool) { - if o == nil || IsNil(o.Extensions) { - return nil, false - } - return o.Extensions, true +func (o *CreateOrUpdateClusterPayload) GetExtensionsOk() (ret CreateOrUpdateClusterPayloadGetExtensionsRetType, ok bool) { + return getCreateOrUpdateClusterPayloadGetExtensionsAttributeTypeOk(o.Extensions) } // HasExtensions returns a boolean if a field has been set. func (o *CreateOrUpdateClusterPayload) HasExtensions() bool { - if o != nil && !IsNil(o.Extensions) { - return true - } - - return false + _, ok := o.GetExtensionsOk() + return ok } // SetExtensions gets a reference to the given Extension and assigns it to the Extensions field. -func (o *CreateOrUpdateClusterPayload) SetExtensions(v *Extension) { - o.Extensions = v +func (o *CreateOrUpdateClusterPayload) SetExtensions(v CreateOrUpdateClusterPayloadGetExtensionsRetType) { + setCreateOrUpdateClusterPayloadGetExtensionsAttributeType(&o.Extensions, v) } // GetHibernation returns the Hibernation field value if set, zero value otherwise. -func (o *CreateOrUpdateClusterPayload) GetHibernation() *Hibernation { - if o == nil || IsNil(o.Hibernation) { - var ret *Hibernation - return ret - } - return o.Hibernation +func (o *CreateOrUpdateClusterPayload) GetHibernation() (res CreateOrUpdateClusterPayloadGetHibernationRetType) { + res, _ = o.GetHibernationOk() + return } // GetHibernationOk returns a tuple with the Hibernation field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateOrUpdateClusterPayload) GetHibernationOk() (*Hibernation, bool) { - if o == nil || IsNil(o.Hibernation) { - return nil, false - } - return o.Hibernation, true +func (o *CreateOrUpdateClusterPayload) GetHibernationOk() (ret CreateOrUpdateClusterPayloadGetHibernationRetType, ok bool) { + return getCreateOrUpdateClusterPayloadGetHibernationAttributeTypeOk(o.Hibernation) } // HasHibernation returns a boolean if a field has been set. func (o *CreateOrUpdateClusterPayload) HasHibernation() bool { - if o != nil && !IsNil(o.Hibernation) { - return true - } - - return false + _, ok := o.GetHibernationOk() + return ok } // SetHibernation gets a reference to the given Hibernation and assigns it to the Hibernation field. -func (o *CreateOrUpdateClusterPayload) SetHibernation(v *Hibernation) { - o.Hibernation = v +func (o *CreateOrUpdateClusterPayload) SetHibernation(v CreateOrUpdateClusterPayloadGetHibernationRetType) { + setCreateOrUpdateClusterPayloadGetHibernationAttributeType(&o.Hibernation, v) } // GetKubernetes returns the Kubernetes field value -func (o *CreateOrUpdateClusterPayload) GetKubernetes() *Kubernetes { - if o == nil || IsNil(o.Kubernetes) { - var ret *Kubernetes - return ret - } - - return o.Kubernetes +func (o *CreateOrUpdateClusterPayload) GetKubernetes() (ret CreateOrUpdateClusterPayloadGetKubernetesRetType) { + ret, _ = o.GetKubernetesOk() + return ret } // GetKubernetesOk returns a tuple with the Kubernetes field value // and a boolean to check if the value has been set. -func (o *CreateOrUpdateClusterPayload) GetKubernetesOk() (*Kubernetes, bool) { - if o == nil { - return nil, false - } - return o.Kubernetes, true +func (o *CreateOrUpdateClusterPayload) GetKubernetesOk() (ret CreateOrUpdateClusterPayloadGetKubernetesRetType, ok bool) { + return getCreateOrUpdateClusterPayloadGetKubernetesAttributeTypeOk(o.Kubernetes) } // SetKubernetes sets field value -func (o *CreateOrUpdateClusterPayload) SetKubernetes(v *Kubernetes) { - o.Kubernetes = v +func (o *CreateOrUpdateClusterPayload) SetKubernetes(v CreateOrUpdateClusterPayloadGetKubernetesRetType) { + setCreateOrUpdateClusterPayloadGetKubernetesAttributeType(&o.Kubernetes, v) } // GetMaintenance returns the Maintenance field value if set, zero value otherwise. -func (o *CreateOrUpdateClusterPayload) GetMaintenance() *Maintenance { - if o == nil || IsNil(o.Maintenance) { - var ret *Maintenance - return ret - } - return o.Maintenance +func (o *CreateOrUpdateClusterPayload) GetMaintenance() (res CreateOrUpdateClusterPayloadGetMaintenanceRetType) { + res, _ = o.GetMaintenanceOk() + return } // GetMaintenanceOk returns a tuple with the Maintenance field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateOrUpdateClusterPayload) GetMaintenanceOk() (*Maintenance, bool) { - if o == nil || IsNil(o.Maintenance) { - return nil, false - } - return o.Maintenance, true +func (o *CreateOrUpdateClusterPayload) GetMaintenanceOk() (ret CreateOrUpdateClusterPayloadGetMaintenanceRetType, ok bool) { + return getCreateOrUpdateClusterPayloadGetMaintenanceAttributeTypeOk(o.Maintenance) } // HasMaintenance returns a boolean if a field has been set. func (o *CreateOrUpdateClusterPayload) HasMaintenance() bool { - if o != nil && !IsNil(o.Maintenance) { - return true - } - - return false + _, ok := o.GetMaintenanceOk() + return ok } // SetMaintenance gets a reference to the given Maintenance and assigns it to the Maintenance field. -func (o *CreateOrUpdateClusterPayload) SetMaintenance(v *Maintenance) { - o.Maintenance = v +func (o *CreateOrUpdateClusterPayload) SetMaintenance(v CreateOrUpdateClusterPayloadGetMaintenanceRetType) { + setCreateOrUpdateClusterPayloadGetMaintenanceAttributeType(&o.Maintenance, v) } // GetNetwork returns the Network field value if set, zero value otherwise. -func (o *CreateOrUpdateClusterPayload) GetNetwork() *Network { - if o == nil || IsNil(o.Network) { - var ret *Network - return ret - } - return o.Network +func (o *CreateOrUpdateClusterPayload) GetNetwork() (res CreateOrUpdateClusterPayloadGetNetworkRetType) { + res, _ = o.GetNetworkOk() + return } // GetNetworkOk returns a tuple with the Network field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateOrUpdateClusterPayload) GetNetworkOk() (*Network, bool) { - if o == nil || IsNil(o.Network) { - return nil, false - } - return o.Network, true +func (o *CreateOrUpdateClusterPayload) GetNetworkOk() (ret CreateOrUpdateClusterPayloadGetNetworkRetType, ok bool) { + return getCreateOrUpdateClusterPayloadGetNetworkAttributeTypeOk(o.Network) } // HasNetwork returns a boolean if a field has been set. func (o *CreateOrUpdateClusterPayload) HasNetwork() bool { - if o != nil && !IsNil(o.Network) { - return true - } - - return false + _, ok := o.GetNetworkOk() + return ok } // SetNetwork gets a reference to the given Network and assigns it to the Network field. -func (o *CreateOrUpdateClusterPayload) SetNetwork(v *Network) { - o.Network = v +func (o *CreateOrUpdateClusterPayload) SetNetwork(v CreateOrUpdateClusterPayloadGetNetworkRetType) { + setCreateOrUpdateClusterPayloadGetNetworkAttributeType(&o.Network, v) } // GetNodepools returns the Nodepools field value -func (o *CreateOrUpdateClusterPayload) GetNodepools() *[]Nodepool { - if o == nil || IsNil(o.Nodepools) { - var ret *[]Nodepool - return ret - } - - return o.Nodepools +func (o *CreateOrUpdateClusterPayload) GetNodepools() (ret CreateOrUpdateClusterPayloadGetNodepoolsRetType) { + ret, _ = o.GetNodepoolsOk() + return ret } // GetNodepoolsOk returns a tuple with the Nodepools field value // and a boolean to check if the value has been set. -func (o *CreateOrUpdateClusterPayload) GetNodepoolsOk() (*[]Nodepool, bool) { - if o == nil { - return nil, false - } - return o.Nodepools, true +func (o *CreateOrUpdateClusterPayload) GetNodepoolsOk() (ret CreateOrUpdateClusterPayloadGetNodepoolsRetType, ok bool) { + return getCreateOrUpdateClusterPayloadGetNodepoolsAttributeTypeOk(o.Nodepools) } // SetNodepools sets field value -func (o *CreateOrUpdateClusterPayload) SetNodepools(v *[]Nodepool) { - o.Nodepools = v +func (o *CreateOrUpdateClusterPayload) SetNodepools(v CreateOrUpdateClusterPayloadGetNodepoolsRetType) { + setCreateOrUpdateClusterPayloadGetNodepoolsAttributeType(&o.Nodepools, v) } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *CreateOrUpdateClusterPayload) GetStatus() *ClusterStatus { - if o == nil || IsNil(o.Status) { - var ret *ClusterStatus - return ret - } - return o.Status +func (o *CreateOrUpdateClusterPayload) GetStatus() (res CreateOrUpdateClusterPayloadGetStatusRetType) { + 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 *CreateOrUpdateClusterPayload) GetStatusOk() (*ClusterStatus, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true +func (o *CreateOrUpdateClusterPayload) GetStatusOk() (ret CreateOrUpdateClusterPayloadGetStatusRetType, ok bool) { + return getCreateOrUpdateClusterPayloadGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. func (o *CreateOrUpdateClusterPayload) HasStatus() bool { - if o != nil && !IsNil(o.Status) { - return true - } - - return false + _, ok := o.GetStatusOk() + return ok } // SetStatus gets a reference to the given ClusterStatus and assigns it to the Status field. -func (o *CreateOrUpdateClusterPayload) SetStatus(v *ClusterStatus) { - o.Status = v +func (o *CreateOrUpdateClusterPayload) SetStatus(v CreateOrUpdateClusterPayloadGetStatusRetType) { + setCreateOrUpdateClusterPayloadGetStatusAttributeType(&o.Status, v) } func (o CreateOrUpdateClusterPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Extensions) { - toSerialize["extensions"] = o.Extensions + if val, ok := getCreateOrUpdateClusterPayloadGetExtensionsAttributeTypeOk(o.Extensions); ok { + toSerialize["Extensions"] = val + } + if val, ok := getCreateOrUpdateClusterPayloadGetHibernationAttributeTypeOk(o.Hibernation); ok { + toSerialize["Hibernation"] = val + } + if val, ok := getCreateOrUpdateClusterPayloadGetKubernetesAttributeTypeOk(o.Kubernetes); ok { + toSerialize["Kubernetes"] = val } - if !IsNil(o.Hibernation) { - toSerialize["hibernation"] = o.Hibernation + if val, ok := getCreateOrUpdateClusterPayloadGetMaintenanceAttributeTypeOk(o.Maintenance); ok { + toSerialize["Maintenance"] = val } - toSerialize["kubernetes"] = o.Kubernetes - if !IsNil(o.Maintenance) { - toSerialize["maintenance"] = o.Maintenance + if val, ok := getCreateOrUpdateClusterPayloadGetNetworkAttributeTypeOk(o.Network); ok { + toSerialize["Network"] = val } - if !IsNil(o.Network) { - toSerialize["network"] = o.Network + if val, ok := getCreateOrUpdateClusterPayloadGetNodepoolsAttributeTypeOk(o.Nodepools); ok { + toSerialize["Nodepools"] = val } - toSerialize["nodepools"] = o.Nodepools - if !IsNil(o.Status) { - toSerialize["status"] = o.Status + if val, ok := getCreateOrUpdateClusterPayloadGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } return toSerialize, nil } diff --git a/services/ske/model_credentials_rotation_state.go b/services/ske/model_credentials_rotation_state.go index d71f40d3e..fa3ab6c3f 100644 --- a/services/ske/model_credentials_rotation_state.go +++ b/services/ske/model_credentials_rotation_state.go @@ -18,14 +18,74 @@ import ( // checks if the CredentialsRotationState type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CredentialsRotationState{} +/* + types and functions for lastCompletionTime +*/ + +// isDateTime +type CredentialsRotationStateGetLastCompletionTimeAttributeType = *time.Time +type CredentialsRotationStateGetLastCompletionTimeArgType = time.Time +type CredentialsRotationStateGetLastCompletionTimeRetType = time.Time + +func getCredentialsRotationStateGetLastCompletionTimeAttributeTypeOk(arg CredentialsRotationStateGetLastCompletionTimeAttributeType) (ret CredentialsRotationStateGetLastCompletionTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCredentialsRotationStateGetLastCompletionTimeAttributeType(arg *CredentialsRotationStateGetLastCompletionTimeAttributeType, val CredentialsRotationStateGetLastCompletionTimeRetType) { + *arg = &val +} + +/* + types and functions for lastInitiationTime +*/ + +// isDateTime +type CredentialsRotationStateGetLastInitiationTimeAttributeType = *time.Time +type CredentialsRotationStateGetLastInitiationTimeArgType = time.Time +type CredentialsRotationStateGetLastInitiationTimeRetType = time.Time + +func getCredentialsRotationStateGetLastInitiationTimeAttributeTypeOk(arg CredentialsRotationStateGetLastInitiationTimeAttributeType) (ret CredentialsRotationStateGetLastInitiationTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCredentialsRotationStateGetLastInitiationTimeAttributeType(arg *CredentialsRotationStateGetLastInitiationTimeAttributeType, val CredentialsRotationStateGetLastInitiationTimeRetType) { + *arg = &val +} + +/* + types and functions for phase +*/ + +// isEnumRef +type CredentialsRotationStateGetPhaseAttributeType = *string +type CredentialsRotationStateGetPhaseArgType = string +type CredentialsRotationStateGetPhaseRetType = string + +func getCredentialsRotationStateGetPhaseAttributeTypeOk(arg CredentialsRotationStateGetPhaseAttributeType) (ret CredentialsRotationStateGetPhaseRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCredentialsRotationStateGetPhaseAttributeType(arg *CredentialsRotationStateGetPhaseAttributeType, val CredentialsRotationStateGetPhaseRetType) { + *arg = &val +} + // CredentialsRotationState struct for CredentialsRotationState type CredentialsRotationState struct { // Format: `2024-02-15T11:06:29Z` - LastCompletionTime *time.Time `json:"lastCompletionTime,omitempty"` + LastCompletionTime CredentialsRotationStateGetLastCompletionTimeAttributeType `json:"lastCompletionTime,omitempty"` // Format: `2024-02-15T11:06:29Z` - LastInitiationTime *time.Time `json:"lastInitiationTime,omitempty"` + LastInitiationTime CredentialsRotationStateGetLastInitiationTimeAttributeType `json:"lastInitiationTime,omitempty"` // Phase of the credentials rotation. `NEVER` indicates that no credentials rotation has been performed using the new credentials rotation endpoints yet. - Phase *string `json:"phase,omitempty"` + Phase CredentialsRotationStateGetPhaseAttributeType `json:"phase,omitempty"` } // NewCredentialsRotationState instantiates a new CredentialsRotationState object @@ -46,111 +106,84 @@ func NewCredentialsRotationStateWithDefaults() *CredentialsRotationState { } // GetLastCompletionTime returns the LastCompletionTime field value if set, zero value otherwise. -func (o *CredentialsRotationState) GetLastCompletionTime() *time.Time { - if o == nil || IsNil(o.LastCompletionTime) { - var ret *time.Time - return ret - } - return o.LastCompletionTime +func (o *CredentialsRotationState) GetLastCompletionTime() (res CredentialsRotationStateGetLastCompletionTimeRetType) { + res, _ = o.GetLastCompletionTimeOk() + return } // GetLastCompletionTimeOk returns a tuple with the LastCompletionTime field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CredentialsRotationState) GetLastCompletionTimeOk() (*time.Time, bool) { - if o == nil || IsNil(o.LastCompletionTime) { - return nil, false - } - return o.LastCompletionTime, true +func (o *CredentialsRotationState) GetLastCompletionTimeOk() (ret CredentialsRotationStateGetLastCompletionTimeRetType, ok bool) { + return getCredentialsRotationStateGetLastCompletionTimeAttributeTypeOk(o.LastCompletionTime) } // HasLastCompletionTime returns a boolean if a field has been set. func (o *CredentialsRotationState) HasLastCompletionTime() bool { - if o != nil && !IsNil(o.LastCompletionTime) { - return true - } - - return false + _, ok := o.GetLastCompletionTimeOk() + return ok } // SetLastCompletionTime gets a reference to the given time.Time and assigns it to the LastCompletionTime field. -func (o *CredentialsRotationState) SetLastCompletionTime(v *time.Time) { - o.LastCompletionTime = v +func (o *CredentialsRotationState) SetLastCompletionTime(v CredentialsRotationStateGetLastCompletionTimeRetType) { + setCredentialsRotationStateGetLastCompletionTimeAttributeType(&o.LastCompletionTime, v) } // GetLastInitiationTime returns the LastInitiationTime field value if set, zero value otherwise. -func (o *CredentialsRotationState) GetLastInitiationTime() *time.Time { - if o == nil || IsNil(o.LastInitiationTime) { - var ret *time.Time - return ret - } - return o.LastInitiationTime +func (o *CredentialsRotationState) GetLastInitiationTime() (res CredentialsRotationStateGetLastInitiationTimeRetType) { + res, _ = o.GetLastInitiationTimeOk() + return } // GetLastInitiationTimeOk returns a tuple with the LastInitiationTime field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CredentialsRotationState) GetLastInitiationTimeOk() (*time.Time, bool) { - if o == nil || IsNil(o.LastInitiationTime) { - return nil, false - } - return o.LastInitiationTime, true +func (o *CredentialsRotationState) GetLastInitiationTimeOk() (ret CredentialsRotationStateGetLastInitiationTimeRetType, ok bool) { + return getCredentialsRotationStateGetLastInitiationTimeAttributeTypeOk(o.LastInitiationTime) } // HasLastInitiationTime returns a boolean if a field has been set. func (o *CredentialsRotationState) HasLastInitiationTime() bool { - if o != nil && !IsNil(o.LastInitiationTime) { - return true - } - - return false + _, ok := o.GetLastInitiationTimeOk() + return ok } // SetLastInitiationTime gets a reference to the given time.Time and assigns it to the LastInitiationTime field. -func (o *CredentialsRotationState) SetLastInitiationTime(v *time.Time) { - o.LastInitiationTime = v +func (o *CredentialsRotationState) SetLastInitiationTime(v CredentialsRotationStateGetLastInitiationTimeRetType) { + setCredentialsRotationStateGetLastInitiationTimeAttributeType(&o.LastInitiationTime, v) } // GetPhase returns the Phase field value if set, zero value otherwise. -func (o *CredentialsRotationState) GetPhase() *string { - if o == nil || IsNil(o.Phase) { - var ret *string - return ret - } - return o.Phase +func (o *CredentialsRotationState) GetPhase() (res CredentialsRotationStateGetPhaseRetType) { + res, _ = o.GetPhaseOk() + return } // GetPhaseOk returns a tuple with the Phase field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CredentialsRotationState) GetPhaseOk() (*string, bool) { - if o == nil || IsNil(o.Phase) { - return nil, false - } - return o.Phase, true +func (o *CredentialsRotationState) GetPhaseOk() (ret CredentialsRotationStateGetPhaseRetType, ok bool) { + return getCredentialsRotationStateGetPhaseAttributeTypeOk(o.Phase) } // HasPhase returns a boolean if a field has been set. func (o *CredentialsRotationState) HasPhase() bool { - if o != nil && !IsNil(o.Phase) { - return true - } - - return false + _, ok := o.GetPhaseOk() + return ok } // SetPhase gets a reference to the given string and assigns it to the Phase field. -func (o *CredentialsRotationState) SetPhase(v *string) { - o.Phase = v +func (o *CredentialsRotationState) SetPhase(v CredentialsRotationStateGetPhaseRetType) { + setCredentialsRotationStateGetPhaseAttributeType(&o.Phase, v) } func (o CredentialsRotationState) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.LastCompletionTime) { - toSerialize["lastCompletionTime"] = o.LastCompletionTime + if val, ok := getCredentialsRotationStateGetLastCompletionTimeAttributeTypeOk(o.LastCompletionTime); ok { + toSerialize["LastCompletionTime"] = val } - if !IsNil(o.LastInitiationTime) { - toSerialize["lastInitiationTime"] = o.LastInitiationTime + if val, ok := getCredentialsRotationStateGetLastInitiationTimeAttributeTypeOk(o.LastInitiationTime); ok { + toSerialize["LastInitiationTime"] = val } - if !IsNil(o.Phase) { - toSerialize["phase"] = o.Phase + if val, ok := getCredentialsRotationStateGetPhaseAttributeTypeOk(o.Phase); ok { + toSerialize["Phase"] = val } return toSerialize, nil } diff --git a/services/ske/model_cri.go b/services/ske/model_cri.go index 702234e8e..58a819c03 100644 --- a/services/ske/model_cri.go +++ b/services/ske/model_cri.go @@ -17,9 +17,29 @@ import ( // checks if the CRI type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CRI{} +/* + types and functions for name +*/ + +// isEnumRef +type CRIGetNameAttributeType = *string +type CRIGetNameArgType = string +type CRIGetNameRetType = string + +func getCRIGetNameAttributeTypeOk(arg CRIGetNameAttributeType) (ret CRIGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCRIGetNameAttributeType(arg *CRIGetNameAttributeType, val CRIGetNameRetType) { + *arg = &val +} + // CRI struct for CRI type CRI struct { - Name *string `json:"name,omitempty"` + Name CRIGetNameAttributeType `json:"name,omitempty"` } // NewCRI instantiates a new CRI object @@ -40,41 +60,32 @@ func NewCRIWithDefaults() *CRI { } // GetName returns the Name field value if set, zero value otherwise. -func (o *CRI) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *CRI) GetName() (res CRIGetNameRetType) { + 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 *CRI) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *CRI) GetNameOk() (ret CRIGetNameRetType, ok bool) { + return getCRIGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *CRI) 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 *CRI) SetName(v *string) { - o.Name = v +func (o *CRI) SetName(v CRIGetNameRetType) { + setCRIGetNameAttributeType(&o.Name, v) } func (o CRI) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getCRIGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } return toSerialize, nil } diff --git a/services/ske/model_dns.go b/services/ske/model_dns.go index 7bd71dc70..7958bdab5 100644 --- a/services/ske/model_dns.go +++ b/services/ske/model_dns.go @@ -17,13 +17,53 @@ import ( // checks if the DNS type satisfies the MappedNullable interface at compile time var _ MappedNullable = &DNS{} +/* + types and functions for enabled +*/ + +// isBoolean +type DNSgetEnabledAttributeType = *bool +type DNSgetEnabledArgType = bool +type DNSgetEnabledRetType = bool + +func getDNSgetEnabledAttributeTypeOk(arg DNSgetEnabledAttributeType) (ret DNSgetEnabledRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDNSgetEnabledAttributeType(arg *DNSgetEnabledAttributeType, val DNSgetEnabledRetType) { + *arg = &val +} + +/* + types and functions for zones +*/ + +// isArray +type DNSGetZonesAttributeType = *[]string +type DNSGetZonesArgType = []string +type DNSGetZonesRetType = []string + +func getDNSGetZonesAttributeTypeOk(arg DNSGetZonesAttributeType) (ret DNSGetZonesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDNSGetZonesAttributeType(arg *DNSGetZonesAttributeType, val DNSGetZonesRetType) { + *arg = &val +} + // DNS struct for DNS type DNS struct { // Enables the dns extension. // REQUIRED - Enabled *bool `json:"enabled"` + Enabled DNSgetEnabledAttributeType `json:"enabled"` // Array of domain filters for externalDNS, e.g., *.runs.onstackit.cloud. - Zones *[]string `json:"zones,omitempty"` + Zones DNSGetZonesAttributeType `json:"zones,omitempty"` } type _DNS DNS @@ -32,9 +72,9 @@ type _DNS DNS // 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 NewDNS(enabled *bool) *DNS { +func NewDNS(enabled DNSgetEnabledArgType) *DNS { this := DNS{} - this.Enabled = enabled + setDNSgetEnabledAttributeType(&this.Enabled, enabled) return &this } @@ -47,66 +87,52 @@ func NewDNSWithDefaults() *DNS { } // GetEnabled returns the Enabled field value -func (o *DNS) GetEnabled() *bool { - if o == nil || IsNil(o.Enabled) { - var ret *bool - return ret - } - - return o.Enabled +func (o *DNS) GetEnabled() (ret DNSgetEnabledRetType) { + ret, _ = o.GetEnabledOk() + return ret } // GetEnabledOk returns a tuple with the Enabled field value // and a boolean to check if the value has been set. -func (o *DNS) GetEnabledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.Enabled, true +func (o *DNS) GetEnabledOk() (ret DNSgetEnabledRetType, ok bool) { + return getDNSgetEnabledAttributeTypeOk(o.Enabled) } // SetEnabled sets field value -func (o *DNS) SetEnabled(v *bool) { - o.Enabled = v +func (o *DNS) SetEnabled(v DNSgetEnabledRetType) { + setDNSgetEnabledAttributeType(&o.Enabled, v) } // GetZones returns the Zones field value if set, zero value otherwise. -func (o *DNS) GetZones() *[]string { - if o == nil || IsNil(o.Zones) { - var ret *[]string - return ret - } - return o.Zones +func (o *DNS) GetZones() (res DNSGetZonesRetType) { + res, _ = o.GetZonesOk() + return } // GetZonesOk returns a tuple with the Zones field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DNS) GetZonesOk() (*[]string, bool) { - if o == nil || IsNil(o.Zones) { - return nil, false - } - return o.Zones, true +func (o *DNS) GetZonesOk() (ret DNSGetZonesRetType, ok bool) { + return getDNSGetZonesAttributeTypeOk(o.Zones) } // HasZones returns a boolean if a field has been set. func (o *DNS) HasZones() bool { - if o != nil && !IsNil(o.Zones) { - return true - } - - return false + _, ok := o.GetZonesOk() + return ok } // SetZones gets a reference to the given []string and assigns it to the Zones field. -func (o *DNS) SetZones(v *[]string) { - o.Zones = v +func (o *DNS) SetZones(v DNSGetZonesRetType) { + setDNSGetZonesAttributeType(&o.Zones, v) } func (o DNS) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["enabled"] = o.Enabled - if !IsNil(o.Zones) { - toSerialize["zones"] = o.Zones + if val, ok := getDNSgetEnabledAttributeTypeOk(o.Enabled); ok { + toSerialize["Enabled"] = val + } + if val, ok := getDNSGetZonesAttributeTypeOk(o.Zones); ok { + toSerialize["Zones"] = val } return toSerialize, nil } diff --git a/services/ske/model_extension.go b/services/ske/model_extension.go index 190cb3f86..fe67e8cda 100644 --- a/services/ske/model_extension.go +++ b/services/ske/model_extension.go @@ -17,11 +17,71 @@ import ( // checks if the Extension type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Extension{} +/* + types and functions for acl +*/ + +// isModel +type ExtensionGetAclAttributeType = *ACL +type ExtensionGetAclArgType = ACL +type ExtensionGetAclRetType = ACL + +func getExtensionGetAclAttributeTypeOk(arg ExtensionGetAclAttributeType) (ret ExtensionGetAclRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setExtensionGetAclAttributeType(arg *ExtensionGetAclAttributeType, val ExtensionGetAclRetType) { + *arg = &val +} + +/* + types and functions for argus +*/ + +// isModel +type ExtensionGetArgusAttributeType = *Argus +type ExtensionGetArgusArgType = Argus +type ExtensionGetArgusRetType = Argus + +func getExtensionGetArgusAttributeTypeOk(arg ExtensionGetArgusAttributeType) (ret ExtensionGetArgusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setExtensionGetArgusAttributeType(arg *ExtensionGetArgusAttributeType, val ExtensionGetArgusRetType) { + *arg = &val +} + +/* + types and functions for dns +*/ + +// isModel +type ExtensionGetDnsAttributeType = *DNS +type ExtensionGetDnsArgType = DNS +type ExtensionGetDnsRetType = DNS + +func getExtensionGetDnsAttributeTypeOk(arg ExtensionGetDnsAttributeType) (ret ExtensionGetDnsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setExtensionGetDnsAttributeType(arg *ExtensionGetDnsAttributeType, val ExtensionGetDnsRetType) { + *arg = &val +} + // Extension struct for Extension type Extension struct { - Acl *ACL `json:"acl,omitempty"` - Argus *Argus `json:"argus,omitempty"` - Dns *DNS `json:"dns,omitempty"` + Acl ExtensionGetAclAttributeType `json:"acl,omitempty"` + Argus ExtensionGetArgusAttributeType `json:"argus,omitempty"` + Dns ExtensionGetDnsAttributeType `json:"dns,omitempty"` } // NewExtension instantiates a new Extension object @@ -42,111 +102,84 @@ func NewExtensionWithDefaults() *Extension { } // GetAcl returns the Acl field value if set, zero value otherwise. -func (o *Extension) GetAcl() *ACL { - if o == nil || IsNil(o.Acl) { - var ret *ACL - return ret - } - return o.Acl +func (o *Extension) GetAcl() (res ExtensionGetAclRetType) { + res, _ = o.GetAclOk() + return } // GetAclOk returns a tuple with the Acl field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Extension) GetAclOk() (*ACL, bool) { - if o == nil || IsNil(o.Acl) { - return nil, false - } - return o.Acl, true +func (o *Extension) GetAclOk() (ret ExtensionGetAclRetType, ok bool) { + return getExtensionGetAclAttributeTypeOk(o.Acl) } // HasAcl returns a boolean if a field has been set. func (o *Extension) HasAcl() bool { - if o != nil && !IsNil(o.Acl) { - return true - } - - return false + _, ok := o.GetAclOk() + return ok } // SetAcl gets a reference to the given ACL and assigns it to the Acl field. -func (o *Extension) SetAcl(v *ACL) { - o.Acl = v +func (o *Extension) SetAcl(v ExtensionGetAclRetType) { + setExtensionGetAclAttributeType(&o.Acl, v) } // GetArgus returns the Argus field value if set, zero value otherwise. -func (o *Extension) GetArgus() *Argus { - if o == nil || IsNil(o.Argus) { - var ret *Argus - return ret - } - return o.Argus +func (o *Extension) GetArgus() (res ExtensionGetArgusRetType) { + res, _ = o.GetArgusOk() + return } // GetArgusOk returns a tuple with the Argus field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Extension) GetArgusOk() (*Argus, bool) { - if o == nil || IsNil(o.Argus) { - return nil, false - } - return o.Argus, true +func (o *Extension) GetArgusOk() (ret ExtensionGetArgusRetType, ok bool) { + return getExtensionGetArgusAttributeTypeOk(o.Argus) } // HasArgus returns a boolean if a field has been set. func (o *Extension) HasArgus() bool { - if o != nil && !IsNil(o.Argus) { - return true - } - - return false + _, ok := o.GetArgusOk() + return ok } // SetArgus gets a reference to the given Argus and assigns it to the Argus field. -func (o *Extension) SetArgus(v *Argus) { - o.Argus = v +func (o *Extension) SetArgus(v ExtensionGetArgusRetType) { + setExtensionGetArgusAttributeType(&o.Argus, v) } // GetDns returns the Dns field value if set, zero value otherwise. -func (o *Extension) GetDns() *DNS { - if o == nil || IsNil(o.Dns) { - var ret *DNS - return ret - } - return o.Dns +func (o *Extension) GetDns() (res ExtensionGetDnsRetType) { + res, _ = o.GetDnsOk() + return } // GetDnsOk returns a tuple with the Dns field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Extension) GetDnsOk() (*DNS, bool) { - if o == nil || IsNil(o.Dns) { - return nil, false - } - return o.Dns, true +func (o *Extension) GetDnsOk() (ret ExtensionGetDnsRetType, ok bool) { + return getExtensionGetDnsAttributeTypeOk(o.Dns) } // HasDns returns a boolean if a field has been set. func (o *Extension) HasDns() bool { - if o != nil && !IsNil(o.Dns) { - return true - } - - return false + _, ok := o.GetDnsOk() + return ok } // SetDns gets a reference to the given DNS and assigns it to the Dns field. -func (o *Extension) SetDns(v *DNS) { - o.Dns = v +func (o *Extension) SetDns(v ExtensionGetDnsRetType) { + setExtensionGetDnsAttributeType(&o.Dns, v) } func (o Extension) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Acl) { - toSerialize["acl"] = o.Acl + if val, ok := getExtensionGetAclAttributeTypeOk(o.Acl); ok { + toSerialize["Acl"] = val } - if !IsNil(o.Argus) { - toSerialize["argus"] = o.Argus + if val, ok := getExtensionGetArgusAttributeTypeOk(o.Argus); ok { + toSerialize["Argus"] = val } - if !IsNil(o.Dns) { - toSerialize["dns"] = o.Dns + if val, ok := getExtensionGetDnsAttributeTypeOk(o.Dns); ok { + toSerialize["Dns"] = val } return toSerialize, nil } diff --git a/services/ske/model_hibernation.go b/services/ske/model_hibernation.go index 5d6b655e5..bc03772e4 100644 --- a/services/ske/model_hibernation.go +++ b/services/ske/model_hibernation.go @@ -17,10 +17,30 @@ import ( // checks if the Hibernation type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Hibernation{} +/* + types and functions for schedules +*/ + +// isArray +type HibernationGetSchedulesAttributeType = *[]HibernationSchedule +type HibernationGetSchedulesArgType = []HibernationSchedule +type HibernationGetSchedulesRetType = []HibernationSchedule + +func getHibernationGetSchedulesAttributeTypeOk(arg HibernationGetSchedulesAttributeType) (ret HibernationGetSchedulesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setHibernationGetSchedulesAttributeType(arg *HibernationGetSchedulesAttributeType, val HibernationGetSchedulesRetType) { + *arg = &val +} + // Hibernation struct for Hibernation type Hibernation struct { // REQUIRED - Schedules *[]HibernationSchedule `json:"schedules"` + Schedules HibernationGetSchedulesAttributeType `json:"schedules"` } type _Hibernation Hibernation @@ -29,9 +49,9 @@ type _Hibernation Hibernation // 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 NewHibernation(schedules *[]HibernationSchedule) *Hibernation { +func NewHibernation(schedules HibernationGetSchedulesArgType) *Hibernation { this := Hibernation{} - this.Schedules = schedules + setHibernationGetSchedulesAttributeType(&this.Schedules, schedules) return &this } @@ -44,32 +64,27 @@ func NewHibernationWithDefaults() *Hibernation { } // GetSchedules returns the Schedules field value -func (o *Hibernation) GetSchedules() *[]HibernationSchedule { - if o == nil || IsNil(o.Schedules) { - var ret *[]HibernationSchedule - return ret - } - - return o.Schedules +func (o *Hibernation) GetSchedules() (ret HibernationGetSchedulesRetType) { + ret, _ = o.GetSchedulesOk() + return ret } // GetSchedulesOk returns a tuple with the Schedules field value // and a boolean to check if the value has been set. -func (o *Hibernation) GetSchedulesOk() (*[]HibernationSchedule, bool) { - if o == nil { - return nil, false - } - return o.Schedules, true +func (o *Hibernation) GetSchedulesOk() (ret HibernationGetSchedulesRetType, ok bool) { + return getHibernationGetSchedulesAttributeTypeOk(o.Schedules) } // SetSchedules sets field value -func (o *Hibernation) SetSchedules(v *[]HibernationSchedule) { - o.Schedules = v +func (o *Hibernation) SetSchedules(v HibernationGetSchedulesRetType) { + setHibernationGetSchedulesAttributeType(&o.Schedules, v) } func (o Hibernation) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["schedules"] = o.Schedules + if val, ok := getHibernationGetSchedulesAttributeTypeOk(o.Schedules); ok { + toSerialize["Schedules"] = val + } return toSerialize, nil } diff --git a/services/ske/model_hibernation_schedule.go b/services/ske/model_hibernation_schedule.go index 01dec8e29..6ce023938 100644 --- a/services/ske/model_hibernation_schedule.go +++ b/services/ske/model_hibernation_schedule.go @@ -17,13 +17,76 @@ import ( // checks if the HibernationSchedule type satisfies the MappedNullable interface at compile time var _ MappedNullable = &HibernationSchedule{} +/* + types and functions for end +*/ + +// isNotNullableString +type HibernationScheduleGetEndAttributeType = *string + +func getHibernationScheduleGetEndAttributeTypeOk(arg HibernationScheduleGetEndAttributeType) (ret HibernationScheduleGetEndRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setHibernationScheduleGetEndAttributeType(arg *HibernationScheduleGetEndAttributeType, val HibernationScheduleGetEndRetType) { + *arg = &val +} + +type HibernationScheduleGetEndArgType = string +type HibernationScheduleGetEndRetType = string + +/* + types and functions for start +*/ + +// isNotNullableString +type HibernationScheduleGetStartAttributeType = *string + +func getHibernationScheduleGetStartAttributeTypeOk(arg HibernationScheduleGetStartAttributeType) (ret HibernationScheduleGetStartRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setHibernationScheduleGetStartAttributeType(arg *HibernationScheduleGetStartAttributeType, val HibernationScheduleGetStartRetType) { + *arg = &val +} + +type HibernationScheduleGetStartArgType = string +type HibernationScheduleGetStartRetType = string + +/* + types and functions for timezone +*/ + +// isNotNullableString +type HibernationScheduleGetTimezoneAttributeType = *string + +func getHibernationScheduleGetTimezoneAttributeTypeOk(arg HibernationScheduleGetTimezoneAttributeType) (ret HibernationScheduleGetTimezoneRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setHibernationScheduleGetTimezoneAttributeType(arg *HibernationScheduleGetTimezoneAttributeType, val HibernationScheduleGetTimezoneRetType) { + *arg = &val +} + +type HibernationScheduleGetTimezoneArgType = string +type HibernationScheduleGetTimezoneRetType = string + // HibernationSchedule struct for HibernationSchedule type HibernationSchedule struct { // REQUIRED - End *string `json:"end"` + End HibernationScheduleGetEndAttributeType `json:"end"` // REQUIRED - Start *string `json:"start"` - Timezone *string `json:"timezone,omitempty"` + Start HibernationScheduleGetStartAttributeType `json:"start"` + Timezone HibernationScheduleGetTimezoneAttributeType `json:"timezone,omitempty"` } type _HibernationSchedule HibernationSchedule @@ -32,10 +95,10 @@ type _HibernationSchedule HibernationSchedule // 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 NewHibernationSchedule(end *string, start *string) *HibernationSchedule { +func NewHibernationSchedule(end HibernationScheduleGetEndArgType, start HibernationScheduleGetStartArgType) *HibernationSchedule { this := HibernationSchedule{} - this.End = end - this.Start = start + setHibernationScheduleGetEndAttributeType(&this.End, end) + setHibernationScheduleGetStartAttributeType(&this.Start, start) return &this } @@ -48,91 +111,72 @@ func NewHibernationScheduleWithDefaults() *HibernationSchedule { } // GetEnd returns the End field value -func (o *HibernationSchedule) GetEnd() *string { - if o == nil || IsNil(o.End) { - var ret *string - return ret - } - - return o.End +func (o *HibernationSchedule) GetEnd() (ret HibernationScheduleGetEndRetType) { + ret, _ = o.GetEndOk() + return ret } // GetEndOk returns a tuple with the End field value // and a boolean to check if the value has been set. -func (o *HibernationSchedule) GetEndOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.End, true +func (o *HibernationSchedule) GetEndOk() (ret HibernationScheduleGetEndRetType, ok bool) { + return getHibernationScheduleGetEndAttributeTypeOk(o.End) } // SetEnd sets field value -func (o *HibernationSchedule) SetEnd(v *string) { - o.End = v +func (o *HibernationSchedule) SetEnd(v HibernationScheduleGetEndRetType) { + setHibernationScheduleGetEndAttributeType(&o.End, v) } // GetStart returns the Start field value -func (o *HibernationSchedule) GetStart() *string { - if o == nil || IsNil(o.Start) { - var ret *string - return ret - } - - return o.Start +func (o *HibernationSchedule) GetStart() (ret HibernationScheduleGetStartRetType) { + ret, _ = o.GetStartOk() + return ret } // GetStartOk returns a tuple with the Start field value // and a boolean to check if the value has been set. -func (o *HibernationSchedule) GetStartOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Start, true +func (o *HibernationSchedule) GetStartOk() (ret HibernationScheduleGetStartRetType, ok bool) { + return getHibernationScheduleGetStartAttributeTypeOk(o.Start) } // SetStart sets field value -func (o *HibernationSchedule) SetStart(v *string) { - o.Start = v +func (o *HibernationSchedule) SetStart(v HibernationScheduleGetStartRetType) { + setHibernationScheduleGetStartAttributeType(&o.Start, v) } // GetTimezone returns the Timezone field value if set, zero value otherwise. -func (o *HibernationSchedule) GetTimezone() *string { - if o == nil || IsNil(o.Timezone) { - var ret *string - return ret - } - return o.Timezone +func (o *HibernationSchedule) GetTimezone() (res HibernationScheduleGetTimezoneRetType) { + res, _ = o.GetTimezoneOk() + return } // GetTimezoneOk returns a tuple with the Timezone field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *HibernationSchedule) GetTimezoneOk() (*string, bool) { - if o == nil || IsNil(o.Timezone) { - return nil, false - } - return o.Timezone, true +func (o *HibernationSchedule) GetTimezoneOk() (ret HibernationScheduleGetTimezoneRetType, ok bool) { + return getHibernationScheduleGetTimezoneAttributeTypeOk(o.Timezone) } // HasTimezone returns a boolean if a field has been set. func (o *HibernationSchedule) HasTimezone() bool { - if o != nil && !IsNil(o.Timezone) { - return true - } - - return false + _, ok := o.GetTimezoneOk() + return ok } // SetTimezone gets a reference to the given string and assigns it to the Timezone field. -func (o *HibernationSchedule) SetTimezone(v *string) { - o.Timezone = v +func (o *HibernationSchedule) SetTimezone(v HibernationScheduleGetTimezoneRetType) { + setHibernationScheduleGetTimezoneAttributeType(&o.Timezone, v) } func (o HibernationSchedule) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["end"] = o.End - toSerialize["start"] = o.Start - if !IsNil(o.Timezone) { - toSerialize["timezone"] = o.Timezone + if val, ok := getHibernationScheduleGetEndAttributeTypeOk(o.End); ok { + toSerialize["End"] = val + } + if val, ok := getHibernationScheduleGetStartAttributeTypeOk(o.Start); ok { + toSerialize["Start"] = val + } + if val, ok := getHibernationScheduleGetTimezoneAttributeTypeOk(o.Timezone); ok { + toSerialize["Timezone"] = val } return toSerialize, nil } diff --git a/services/ske/model_image.go b/services/ske/model_image.go index 46ac16e46..4fc83b665 100644 --- a/services/ske/model_image.go +++ b/services/ske/model_image.go @@ -17,12 +17,54 @@ import ( // checks if the Image type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Image{} +/* + 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 version +*/ + +// isNotNullableString +type ImageGetVersionAttributeType = *string + +func getImageGetVersionAttributeTypeOk(arg ImageGetVersionAttributeType) (ret ImageGetVersionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setImageGetVersionAttributeType(arg *ImageGetVersionAttributeType, val ImageGetVersionRetType) { + *arg = &val +} + +type ImageGetVersionArgType = string +type ImageGetVersionRetType = string + // Image For valid names and versions please take a look at [provider-options](#tag/ProviderOptions/operation/SkeService_GetProviderOptions) `machineImages`. type Image struct { // REQUIRED - Name *string `json:"name"` + Name ImageGetNameAttributeType `json:"name"` // REQUIRED - Version *string `json:"version"` + Version ImageGetVersionAttributeType `json:"version"` } type _Image Image @@ -31,10 +73,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(name *string, version *string) *Image { +func NewImage(name ImageGetNameArgType, version ImageGetVersionArgType) *Image { this := Image{} - this.Name = name - this.Version = version + setImageGetNameAttributeType(&this.Name, name) + setImageGetVersionAttributeType(&this.Version, version) return &this } @@ -47,57 +89,47 @@ func NewImageWithDefaults() *Image { } // 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) } // GetVersion returns the Version field value -func (o *Image) GetVersion() *string { - if o == nil || IsNil(o.Version) { - var ret *string - return ret - } - - return o.Version +func (o *Image) GetVersion() (ret ImageGetVersionRetType) { + ret, _ = o.GetVersionOk() + return ret } // GetVersionOk returns a tuple with the Version field value // and a boolean to check if the value has been set. -func (o *Image) GetVersionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Version, true +func (o *Image) GetVersionOk() (ret ImageGetVersionRetType, ok bool) { + return getImageGetVersionAttributeTypeOk(o.Version) } // SetVersion sets field value -func (o *Image) SetVersion(v *string) { - o.Version = v +func (o *Image) SetVersion(v ImageGetVersionRetType) { + setImageGetVersionAttributeType(&o.Version, v) } func (o Image) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["name"] = o.Name - toSerialize["version"] = o.Version + if val, ok := getImageGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getImageGetVersionAttributeTypeOk(o.Version); ok { + toSerialize["Version"] = val + } return toSerialize, nil } diff --git a/services/ske/model_kubeconfig.go b/services/ske/model_kubeconfig.go index 696a43da8..6ed0c68d1 100644 --- a/services/ske/model_kubeconfig.go +++ b/services/ske/model_kubeconfig.go @@ -18,10 +18,51 @@ import ( // checks if the Kubeconfig type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Kubeconfig{} +/* + types and functions for expirationTimestamp +*/ + +// isDateTime +type KubeconfigGetExpirationTimestampAttributeType = *time.Time +type KubeconfigGetExpirationTimestampArgType = time.Time +type KubeconfigGetExpirationTimestampRetType = time.Time + +func getKubeconfigGetExpirationTimestampAttributeTypeOk(arg KubeconfigGetExpirationTimestampAttributeType) (ret KubeconfigGetExpirationTimestampRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setKubeconfigGetExpirationTimestampAttributeType(arg *KubeconfigGetExpirationTimestampAttributeType, val KubeconfigGetExpirationTimestampRetType) { + *arg = &val +} + +/* + types and functions for kubeconfig +*/ + +// isNotNullableString +type KubeconfigGetKubeconfigAttributeType = *string + +func getKubeconfigGetKubeconfigAttributeTypeOk(arg KubeconfigGetKubeconfigAttributeType) (ret KubeconfigGetKubeconfigRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setKubeconfigGetKubeconfigAttributeType(arg *KubeconfigGetKubeconfigAttributeType, val KubeconfigGetKubeconfigRetType) { + *arg = &val +} + +type KubeconfigGetKubeconfigArgType = string +type KubeconfigGetKubeconfigRetType = string + // Kubeconfig struct for Kubeconfig type Kubeconfig struct { - ExpirationTimestamp *time.Time `json:"expirationTimestamp,omitempty"` - Kubeconfig *string `json:"kubeconfig,omitempty"` + ExpirationTimestamp KubeconfigGetExpirationTimestampAttributeType `json:"expirationTimestamp,omitempty"` + Kubeconfig KubeconfigGetKubeconfigAttributeType `json:"kubeconfig,omitempty"` } // NewKubeconfig instantiates a new Kubeconfig object @@ -42,76 +83,58 @@ func NewKubeconfigWithDefaults() *Kubeconfig { } // GetExpirationTimestamp returns the ExpirationTimestamp field value if set, zero value otherwise. -func (o *Kubeconfig) GetExpirationTimestamp() *time.Time { - if o == nil || IsNil(o.ExpirationTimestamp) { - var ret *time.Time - return ret - } - return o.ExpirationTimestamp +func (o *Kubeconfig) GetExpirationTimestamp() (res KubeconfigGetExpirationTimestampRetType) { + res, _ = o.GetExpirationTimestampOk() + return } // GetExpirationTimestampOk returns a tuple with the ExpirationTimestamp field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Kubeconfig) GetExpirationTimestampOk() (*time.Time, bool) { - if o == nil || IsNil(o.ExpirationTimestamp) { - return nil, false - } - return o.ExpirationTimestamp, true +func (o *Kubeconfig) GetExpirationTimestampOk() (ret KubeconfigGetExpirationTimestampRetType, ok bool) { + return getKubeconfigGetExpirationTimestampAttributeTypeOk(o.ExpirationTimestamp) } // HasExpirationTimestamp returns a boolean if a field has been set. func (o *Kubeconfig) HasExpirationTimestamp() bool { - if o != nil && !IsNil(o.ExpirationTimestamp) { - return true - } - - return false + _, ok := o.GetExpirationTimestampOk() + return ok } // SetExpirationTimestamp gets a reference to the given time.Time and assigns it to the ExpirationTimestamp field. -func (o *Kubeconfig) SetExpirationTimestamp(v *time.Time) { - o.ExpirationTimestamp = v +func (o *Kubeconfig) SetExpirationTimestamp(v KubeconfigGetExpirationTimestampRetType) { + setKubeconfigGetExpirationTimestampAttributeType(&o.ExpirationTimestamp, v) } // GetKubeconfig returns the Kubeconfig field value if set, zero value otherwise. -func (o *Kubeconfig) GetKubeconfig() *string { - if o == nil || IsNil(o.Kubeconfig) { - var ret *string - return ret - } - return o.Kubeconfig +func (o *Kubeconfig) GetKubeconfig() (res KubeconfigGetKubeconfigRetType) { + res, _ = o.GetKubeconfigOk() + return } // GetKubeconfigOk returns a tuple with the Kubeconfig field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Kubeconfig) GetKubeconfigOk() (*string, bool) { - if o == nil || IsNil(o.Kubeconfig) { - return nil, false - } - return o.Kubeconfig, true +func (o *Kubeconfig) GetKubeconfigOk() (ret KubeconfigGetKubeconfigRetType, ok bool) { + return getKubeconfigGetKubeconfigAttributeTypeOk(o.Kubeconfig) } // HasKubeconfig returns a boolean if a field has been set. func (o *Kubeconfig) HasKubeconfig() bool { - if o != nil && !IsNil(o.Kubeconfig) { - return true - } - - return false + _, ok := o.GetKubeconfigOk() + return ok } // SetKubeconfig gets a reference to the given string and assigns it to the Kubeconfig field. -func (o *Kubeconfig) SetKubeconfig(v *string) { - o.Kubeconfig = v +func (o *Kubeconfig) SetKubeconfig(v KubeconfigGetKubeconfigRetType) { + setKubeconfigGetKubeconfigAttributeType(&o.Kubeconfig, v) } func (o Kubeconfig) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.ExpirationTimestamp) { - toSerialize["expirationTimestamp"] = o.ExpirationTimestamp + if val, ok := getKubeconfigGetExpirationTimestampAttributeTypeOk(o.ExpirationTimestamp); ok { + toSerialize["ExpirationTimestamp"] = val } - if !IsNil(o.Kubeconfig) { - toSerialize["kubeconfig"] = o.Kubeconfig + if val, ok := getKubeconfigGetKubeconfigAttributeTypeOk(o.Kubeconfig); ok { + toSerialize["Kubeconfig"] = val } return toSerialize, nil } diff --git a/services/ske/model_kubernetes.go b/services/ske/model_kubernetes.go index b96db2e25..f82c25b32 100644 --- a/services/ske/model_kubernetes.go +++ b/services/ske/model_kubernetes.go @@ -17,12 +17,53 @@ import ( // checks if the Kubernetes type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Kubernetes{} +/* + types and functions for allowPrivilegedContainers +*/ + +// isBoolean +type KubernetesgetAllowPrivilegedContainersAttributeType = *bool +type KubernetesgetAllowPrivilegedContainersArgType = bool +type KubernetesgetAllowPrivilegedContainersRetType = bool + +func getKubernetesgetAllowPrivilegedContainersAttributeTypeOk(arg KubernetesgetAllowPrivilegedContainersAttributeType) (ret KubernetesgetAllowPrivilegedContainersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setKubernetesgetAllowPrivilegedContainersAttributeType(arg *KubernetesgetAllowPrivilegedContainersAttributeType, val KubernetesgetAllowPrivilegedContainersRetType) { + *arg = &val +} + +/* + types and functions for version +*/ + +// isNotNullableString +type KubernetesGetVersionAttributeType = *string + +func getKubernetesGetVersionAttributeTypeOk(arg KubernetesGetVersionAttributeType) (ret KubernetesGetVersionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setKubernetesGetVersionAttributeType(arg *KubernetesGetVersionAttributeType, val KubernetesGetVersionRetType) { + *arg = &val +} + +type KubernetesGetVersionArgType = string +type KubernetesGetVersionRetType = string + // Kubernetes For valid versions please take a look at [provider-options](#tag/ProviderOptions/operation/SkeService_GetProviderOptions) `kubernetesVersions`. type Kubernetes struct { // DEPRECATED as of Kubernetes 1.25+ Flag to specify if privileged mode for containers is enabled or not. This should be used with care since it also disables a couple of other features like the use of some volume type (e.g. PVCs). By default this is set to true. - AllowPrivilegedContainers *bool `json:"allowPrivilegedContainers,omitempty"` + AllowPrivilegedContainers KubernetesgetAllowPrivilegedContainersAttributeType `json:"allowPrivilegedContainers,omitempty"` // REQUIRED - Version *string `json:"version"` + Version KubernetesGetVersionAttributeType `json:"version"` } type _Kubernetes Kubernetes @@ -31,9 +72,9 @@ type _Kubernetes Kubernetes // 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 NewKubernetes(version *string) *Kubernetes { +func NewKubernetes(version KubernetesGetVersionArgType) *Kubernetes { this := Kubernetes{} - this.Version = version + setKubernetesGetVersionAttributeType(&this.Version, version) return &this } @@ -46,67 +87,53 @@ func NewKubernetesWithDefaults() *Kubernetes { } // GetAllowPrivilegedContainers returns the AllowPrivilegedContainers field value if set, zero value otherwise. -func (o *Kubernetes) GetAllowPrivilegedContainers() *bool { - if o == nil || IsNil(o.AllowPrivilegedContainers) { - var ret *bool - return ret - } - return o.AllowPrivilegedContainers +func (o *Kubernetes) GetAllowPrivilegedContainers() (res KubernetesgetAllowPrivilegedContainersRetType) { + res, _ = o.GetAllowPrivilegedContainersOk() + return } // GetAllowPrivilegedContainersOk returns a tuple with the AllowPrivilegedContainers field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Kubernetes) GetAllowPrivilegedContainersOk() (*bool, bool) { - if o == nil || IsNil(o.AllowPrivilegedContainers) { - return nil, false - } - return o.AllowPrivilegedContainers, true +func (o *Kubernetes) GetAllowPrivilegedContainersOk() (ret KubernetesgetAllowPrivilegedContainersRetType, ok bool) { + return getKubernetesgetAllowPrivilegedContainersAttributeTypeOk(o.AllowPrivilegedContainers) } // HasAllowPrivilegedContainers returns a boolean if a field has been set. func (o *Kubernetes) HasAllowPrivilegedContainers() bool { - if o != nil && !IsNil(o.AllowPrivilegedContainers) { - return true - } - - return false + _, ok := o.GetAllowPrivilegedContainersOk() + return ok } // SetAllowPrivilegedContainers gets a reference to the given bool and assigns it to the AllowPrivilegedContainers field. -func (o *Kubernetes) SetAllowPrivilegedContainers(v *bool) { - o.AllowPrivilegedContainers = v +func (o *Kubernetes) SetAllowPrivilegedContainers(v KubernetesgetAllowPrivilegedContainersRetType) { + setKubernetesgetAllowPrivilegedContainersAttributeType(&o.AllowPrivilegedContainers, v) } // GetVersion returns the Version field value -func (o *Kubernetes) GetVersion() *string { - if o == nil || IsNil(o.Version) { - var ret *string - return ret - } - - return o.Version +func (o *Kubernetes) GetVersion() (ret KubernetesGetVersionRetType) { + ret, _ = o.GetVersionOk() + return ret } // GetVersionOk returns a tuple with the Version field value // and a boolean to check if the value has been set. -func (o *Kubernetes) GetVersionOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Version, true +func (o *Kubernetes) GetVersionOk() (ret KubernetesGetVersionRetType, ok bool) { + return getKubernetesGetVersionAttributeTypeOk(o.Version) } // SetVersion sets field value -func (o *Kubernetes) SetVersion(v *string) { - o.Version = v +func (o *Kubernetes) SetVersion(v KubernetesGetVersionRetType) { + setKubernetesGetVersionAttributeType(&o.Version, v) } func (o Kubernetes) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.AllowPrivilegedContainers) { - toSerialize["allowPrivilegedContainers"] = o.AllowPrivilegedContainers + if val, ok := getKubernetesgetAllowPrivilegedContainersAttributeTypeOk(o.AllowPrivilegedContainers); ok { + toSerialize["AllowPrivilegedContainers"] = val + } + if val, ok := getKubernetesGetVersionAttributeTypeOk(o.Version); ok { + toSerialize["Version"] = val } - toSerialize["version"] = o.Version return toSerialize, nil } diff --git a/services/ske/model_kubernetes_version.go b/services/ske/model_kubernetes_version.go index 0a0f106f8..2f0e2d408 100644 --- a/services/ske/model_kubernetes_version.go +++ b/services/ske/model_kubernetes_version.go @@ -18,12 +18,94 @@ import ( // checks if the KubernetesVersion type satisfies the MappedNullable interface at compile time var _ MappedNullable = &KubernetesVersion{} +/* + types and functions for expirationDate +*/ + +// isDateTime +type KubernetesVersionGetExpirationDateAttributeType = *time.Time +type KubernetesVersionGetExpirationDateArgType = time.Time +type KubernetesVersionGetExpirationDateRetType = time.Time + +func getKubernetesVersionGetExpirationDateAttributeTypeOk(arg KubernetesVersionGetExpirationDateAttributeType) (ret KubernetesVersionGetExpirationDateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setKubernetesVersionGetExpirationDateAttributeType(arg *KubernetesVersionGetExpirationDateAttributeType, val KubernetesVersionGetExpirationDateRetType) { + *arg = &val +} + +/* + types and functions for featureGates +*/ + +// isContainer +type KubernetesVersionGetFeatureGatesAttributeType = *map[string]string +type KubernetesVersionGetFeatureGatesArgType = map[string]string +type KubernetesVersionGetFeatureGatesRetType = map[string]string + +func getKubernetesVersionGetFeatureGatesAttributeTypeOk(arg KubernetesVersionGetFeatureGatesAttributeType) (ret KubernetesVersionGetFeatureGatesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setKubernetesVersionGetFeatureGatesAttributeType(arg *KubernetesVersionGetFeatureGatesAttributeType, val KubernetesVersionGetFeatureGatesRetType) { + *arg = &val +} + +/* + types and functions for state +*/ + +// isNotNullableString +type KubernetesVersionGetStateAttributeType = *string + +func getKubernetesVersionGetStateAttributeTypeOk(arg KubernetesVersionGetStateAttributeType) (ret KubernetesVersionGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setKubernetesVersionGetStateAttributeType(arg *KubernetesVersionGetStateAttributeType, val KubernetesVersionGetStateRetType) { + *arg = &val +} + +type KubernetesVersionGetStateArgType = string +type KubernetesVersionGetStateRetType = string + +/* + types and functions for version +*/ + +// isNotNullableString +type KubernetesVersionGetVersionAttributeType = *string + +func getKubernetesVersionGetVersionAttributeTypeOk(arg KubernetesVersionGetVersionAttributeType) (ret KubernetesVersionGetVersionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setKubernetesVersionGetVersionAttributeType(arg *KubernetesVersionGetVersionAttributeType, val KubernetesVersionGetVersionRetType) { + *arg = &val +} + +type KubernetesVersionGetVersionArgType = string +type KubernetesVersionGetVersionRetType = string + // KubernetesVersion struct for KubernetesVersion type KubernetesVersion struct { - ExpirationDate *time.Time `json:"expirationDate,omitempty"` - FeatureGates *map[string]string `json:"featureGates,omitempty"` - State *string `json:"state,omitempty"` - Version *string `json:"version,omitempty"` + ExpirationDate KubernetesVersionGetExpirationDateAttributeType `json:"expirationDate,omitempty"` + FeatureGates KubernetesVersionGetFeatureGatesAttributeType `json:"featureGates,omitempty"` + State KubernetesVersionGetStateAttributeType `json:"state,omitempty"` + Version KubernetesVersionGetVersionAttributeType `json:"version,omitempty"` } // NewKubernetesVersion instantiates a new KubernetesVersion object @@ -44,146 +126,110 @@ func NewKubernetesVersionWithDefaults() *KubernetesVersion { } // GetExpirationDate returns the ExpirationDate field value if set, zero value otherwise. -func (o *KubernetesVersion) GetExpirationDate() *time.Time { - if o == nil || IsNil(o.ExpirationDate) { - var ret *time.Time - return ret - } - return o.ExpirationDate +func (o *KubernetesVersion) GetExpirationDate() (res KubernetesVersionGetExpirationDateRetType) { + res, _ = o.GetExpirationDateOk() + return } // GetExpirationDateOk returns a tuple with the ExpirationDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *KubernetesVersion) GetExpirationDateOk() (*time.Time, bool) { - if o == nil || IsNil(o.ExpirationDate) { - return nil, false - } - return o.ExpirationDate, true +func (o *KubernetesVersion) GetExpirationDateOk() (ret KubernetesVersionGetExpirationDateRetType, ok bool) { + return getKubernetesVersionGetExpirationDateAttributeTypeOk(o.ExpirationDate) } // HasExpirationDate returns a boolean if a field has been set. func (o *KubernetesVersion) HasExpirationDate() bool { - if o != nil && !IsNil(o.ExpirationDate) { - return true - } - - return false + _, ok := o.GetExpirationDateOk() + return ok } // SetExpirationDate gets a reference to the given time.Time and assigns it to the ExpirationDate field. -func (o *KubernetesVersion) SetExpirationDate(v *time.Time) { - o.ExpirationDate = v +func (o *KubernetesVersion) SetExpirationDate(v KubernetesVersionGetExpirationDateRetType) { + setKubernetesVersionGetExpirationDateAttributeType(&o.ExpirationDate, v) } // GetFeatureGates returns the FeatureGates field value if set, zero value otherwise. -func (o *KubernetesVersion) GetFeatureGates() *map[string]string { - if o == nil || IsNil(o.FeatureGates) { - var ret *map[string]string - return ret - } - return o.FeatureGates +func (o *KubernetesVersion) GetFeatureGates() (res KubernetesVersionGetFeatureGatesRetType) { + res, _ = o.GetFeatureGatesOk() + return } // GetFeatureGatesOk returns a tuple with the FeatureGates field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *KubernetesVersion) GetFeatureGatesOk() (*map[string]string, bool) { - if o == nil || IsNil(o.FeatureGates) { - return nil, false - } - return o.FeatureGates, true +func (o *KubernetesVersion) GetFeatureGatesOk() (ret KubernetesVersionGetFeatureGatesRetType, ok bool) { + return getKubernetesVersionGetFeatureGatesAttributeTypeOk(o.FeatureGates) } // HasFeatureGates returns a boolean if a field has been set. func (o *KubernetesVersion) HasFeatureGates() bool { - if o != nil && !IsNil(o.FeatureGates) { - return true - } - - return false + _, ok := o.GetFeatureGatesOk() + return ok } // SetFeatureGates gets a reference to the given map[string]string and assigns it to the FeatureGates field. -func (o *KubernetesVersion) SetFeatureGates(v *map[string]string) { - o.FeatureGates = v +func (o *KubernetesVersion) SetFeatureGates(v KubernetesVersionGetFeatureGatesRetType) { + setKubernetesVersionGetFeatureGatesAttributeType(&o.FeatureGates, v) } // GetState returns the State field value if set, zero value otherwise. -func (o *KubernetesVersion) GetState() *string { - if o == nil || IsNil(o.State) { - var ret *string - return ret - } - return o.State +func (o *KubernetesVersion) GetState() (res KubernetesVersionGetStateRetType) { + res, _ = o.GetStateOk() + return } // GetStateOk returns a tuple with the State field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *KubernetesVersion) GetStateOk() (*string, bool) { - if o == nil || IsNil(o.State) { - return nil, false - } - return o.State, true +func (o *KubernetesVersion) GetStateOk() (ret KubernetesVersionGetStateRetType, ok bool) { + return getKubernetesVersionGetStateAttributeTypeOk(o.State) } // HasState returns a boolean if a field has been set. func (o *KubernetesVersion) HasState() bool { - if o != nil && !IsNil(o.State) { - return true - } - - return false + _, ok := o.GetStateOk() + return ok } // SetState gets a reference to the given string and assigns it to the State field. -func (o *KubernetesVersion) SetState(v *string) { - o.State = v +func (o *KubernetesVersion) SetState(v KubernetesVersionGetStateRetType) { + setKubernetesVersionGetStateAttributeType(&o.State, v) } // GetVersion returns the Version field value if set, zero value otherwise. -func (o *KubernetesVersion) GetVersion() *string { - if o == nil || IsNil(o.Version) { - var ret *string - return ret - } - return o.Version +func (o *KubernetesVersion) GetVersion() (res KubernetesVersionGetVersionRetType) { + res, _ = o.GetVersionOk() + return } // GetVersionOk returns a tuple with the Version field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *KubernetesVersion) GetVersionOk() (*string, bool) { - if o == nil || IsNil(o.Version) { - return nil, false - } - return o.Version, true +func (o *KubernetesVersion) GetVersionOk() (ret KubernetesVersionGetVersionRetType, ok bool) { + return getKubernetesVersionGetVersionAttributeTypeOk(o.Version) } // HasVersion returns a boolean if a field has been set. func (o *KubernetesVersion) HasVersion() bool { - if o != nil && !IsNil(o.Version) { - return true - } - - return false + _, ok := o.GetVersionOk() + return ok } // SetVersion gets a reference to the given string and assigns it to the Version field. -func (o *KubernetesVersion) SetVersion(v *string) { - o.Version = v +func (o *KubernetesVersion) SetVersion(v KubernetesVersionGetVersionRetType) { + setKubernetesVersionGetVersionAttributeType(&o.Version, v) } func (o KubernetesVersion) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.ExpirationDate) { - toSerialize["expirationDate"] = o.ExpirationDate + if val, ok := getKubernetesVersionGetExpirationDateAttributeTypeOk(o.ExpirationDate); ok { + toSerialize["ExpirationDate"] = val } - if !IsNil(o.FeatureGates) { - toSerialize["featureGates"] = o.FeatureGates + if val, ok := getKubernetesVersionGetFeatureGatesAttributeTypeOk(o.FeatureGates); ok { + toSerialize["FeatureGates"] = val } - if !IsNil(o.State) { - toSerialize["state"] = o.State + if val, ok := getKubernetesVersionGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val } - if !IsNil(o.Version) { - toSerialize["version"] = o.Version + if val, ok := getKubernetesVersionGetVersionAttributeTypeOk(o.Version); ok { + toSerialize["Version"] = val } return toSerialize, nil } diff --git a/services/ske/model_list_clusters_response.go b/services/ske/model_list_clusters_response.go index 967540e75..af2b88b8e 100644 --- a/services/ske/model_list_clusters_response.go +++ b/services/ske/model_list_clusters_response.go @@ -17,9 +17,29 @@ import ( // checks if the ListClustersResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListClustersResponse{} +/* + types and functions for items +*/ + +// isArray +type ListClustersResponseGetItemsAttributeType = *[]Cluster +type ListClustersResponseGetItemsArgType = []Cluster +type ListClustersResponseGetItemsRetType = []Cluster + +func getListClustersResponseGetItemsAttributeTypeOk(arg ListClustersResponseGetItemsAttributeType) (ret ListClustersResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListClustersResponseGetItemsAttributeType(arg *ListClustersResponseGetItemsAttributeType, val ListClustersResponseGetItemsRetType) { + *arg = &val +} + // ListClustersResponse struct for ListClustersResponse type ListClustersResponse struct { - Items *[]Cluster `json:"items,omitempty"` + Items ListClustersResponseGetItemsAttributeType `json:"items,omitempty"` } // NewListClustersResponse instantiates a new ListClustersResponse object @@ -40,41 +60,32 @@ func NewListClustersResponseWithDefaults() *ListClustersResponse { } // GetItems returns the Items field value if set, zero value otherwise. -func (o *ListClustersResponse) GetItems() *[]Cluster { - if o == nil || IsNil(o.Items) { - var ret *[]Cluster - return ret - } - return o.Items +func (o *ListClustersResponse) GetItems() (res ListClustersResponseGetItemsRetType) { + res, _ = o.GetItemsOk() + return } // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListClustersResponse) GetItemsOk() (*[]Cluster, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true +func (o *ListClustersResponse) GetItemsOk() (ret ListClustersResponseGetItemsRetType, ok bool) { + return getListClustersResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. func (o *ListClustersResponse) HasItems() bool { - if o != nil && !IsNil(o.Items) { - return true - } - - return false + _, ok := o.GetItemsOk() + return ok } // SetItems gets a reference to the given []Cluster and assigns it to the Items field. -func (o *ListClustersResponse) SetItems(v *[]Cluster) { - o.Items = v +func (o *ListClustersResponse) SetItems(v ListClustersResponseGetItemsRetType) { + setListClustersResponseGetItemsAttributeType(&o.Items, v) } func (o ListClustersResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Items) { - toSerialize["items"] = o.Items + if val, ok := getListClustersResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val } return toSerialize, nil } diff --git a/services/ske/model_login_kubeconfig.go b/services/ske/model_login_kubeconfig.go index 238bb7d42..839aefb75 100644 --- a/services/ske/model_login_kubeconfig.go +++ b/services/ske/model_login_kubeconfig.go @@ -17,9 +17,30 @@ import ( // checks if the LoginKubeconfig type satisfies the MappedNullable interface at compile time var _ MappedNullable = &LoginKubeconfig{} +/* + types and functions for kubeconfig +*/ + +// isNotNullableString +type LoginKubeconfigGetKubeconfigAttributeType = *string + +func getLoginKubeconfigGetKubeconfigAttributeTypeOk(arg LoginKubeconfigGetKubeconfigAttributeType) (ret LoginKubeconfigGetKubeconfigRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setLoginKubeconfigGetKubeconfigAttributeType(arg *LoginKubeconfigGetKubeconfigAttributeType, val LoginKubeconfigGetKubeconfigRetType) { + *arg = &val +} + +type LoginKubeconfigGetKubeconfigArgType = string +type LoginKubeconfigGetKubeconfigRetType = string + // LoginKubeconfig struct for LoginKubeconfig type LoginKubeconfig struct { - Kubeconfig *string `json:"kubeconfig,omitempty"` + Kubeconfig LoginKubeconfigGetKubeconfigAttributeType `json:"kubeconfig,omitempty"` } // NewLoginKubeconfig instantiates a new LoginKubeconfig object @@ -40,41 +61,32 @@ func NewLoginKubeconfigWithDefaults() *LoginKubeconfig { } // GetKubeconfig returns the Kubeconfig field value if set, zero value otherwise. -func (o *LoginKubeconfig) GetKubeconfig() *string { - if o == nil || IsNil(o.Kubeconfig) { - var ret *string - return ret - } - return o.Kubeconfig +func (o *LoginKubeconfig) GetKubeconfig() (res LoginKubeconfigGetKubeconfigRetType) { + res, _ = o.GetKubeconfigOk() + return } // GetKubeconfigOk returns a tuple with the Kubeconfig field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *LoginKubeconfig) GetKubeconfigOk() (*string, bool) { - if o == nil || IsNil(o.Kubeconfig) { - return nil, false - } - return o.Kubeconfig, true +func (o *LoginKubeconfig) GetKubeconfigOk() (ret LoginKubeconfigGetKubeconfigRetType, ok bool) { + return getLoginKubeconfigGetKubeconfigAttributeTypeOk(o.Kubeconfig) } // HasKubeconfig returns a boolean if a field has been set. func (o *LoginKubeconfig) HasKubeconfig() bool { - if o != nil && !IsNil(o.Kubeconfig) { - return true - } - - return false + _, ok := o.GetKubeconfigOk() + return ok } // SetKubeconfig gets a reference to the given string and assigns it to the Kubeconfig field. -func (o *LoginKubeconfig) SetKubeconfig(v *string) { - o.Kubeconfig = v +func (o *LoginKubeconfig) SetKubeconfig(v LoginKubeconfigGetKubeconfigRetType) { + setLoginKubeconfigGetKubeconfigAttributeType(&o.Kubeconfig, v) } func (o LoginKubeconfig) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Kubeconfig) { - toSerialize["kubeconfig"] = o.Kubeconfig + if val, ok := getLoginKubeconfigGetKubeconfigAttributeTypeOk(o.Kubeconfig); ok { + toSerialize["Kubeconfig"] = val } return toSerialize, nil } diff --git a/services/ske/model_machine.go b/services/ske/model_machine.go index 08eb6058e..9e4ae3b09 100644 --- a/services/ske/model_machine.go +++ b/services/ske/model_machine.go @@ -17,13 +17,54 @@ import ( // checks if the Machine type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Machine{} +/* + types and functions for image +*/ + +// isModel +type MachineGetImageAttributeType = *Image +type MachineGetImageArgType = Image +type MachineGetImageRetType = Image + +func getMachineGetImageAttributeTypeOk(arg MachineGetImageAttributeType) (ret MachineGetImageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMachineGetImageAttributeType(arg *MachineGetImageAttributeType, val MachineGetImageRetType) { + *arg = &val +} + +/* + types and functions for type +*/ + +// isNotNullableString +type MachineGetTypeAttributeType = *string + +func getMachineGetTypeAttributeTypeOk(arg MachineGetTypeAttributeType) (ret MachineGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMachineGetTypeAttributeType(arg *MachineGetTypeAttributeType, val MachineGetTypeRetType) { + *arg = &val +} + +type MachineGetTypeArgType = string +type MachineGetTypeRetType = string + // Machine struct for Machine type Machine struct { // REQUIRED - Image *Image `json:"image"` + Image MachineGetImageAttributeType `json:"image"` // For valid types please take a look at [provider-options](#tag/ProviderOptions/operation/SkeService_GetProviderOptions) `machineTypes`. // REQUIRED - Type *string `json:"type"` + Type MachineGetTypeAttributeType `json:"type"` } type _Machine Machine @@ -32,10 +73,10 @@ type _Machine Machine // 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 NewMachine(image *Image, type_ *string) *Machine { +func NewMachine(image MachineGetImageArgType, type_ MachineGetTypeArgType) *Machine { this := Machine{} - this.Image = image - this.Type = type_ + setMachineGetImageAttributeType(&this.Image, image) + setMachineGetTypeAttributeType(&this.Type, type_) return &this } @@ -48,57 +89,47 @@ func NewMachineWithDefaults() *Machine { } // GetImage returns the Image field value -func (o *Machine) GetImage() *Image { - if o == nil || IsNil(o.Image) { - var ret *Image - return ret - } - - return o.Image +func (o *Machine) GetImage() (ret MachineGetImageRetType) { + 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 *Machine) GetImageOk() (*Image, bool) { - if o == nil { - return nil, false - } - return o.Image, true +func (o *Machine) GetImageOk() (ret MachineGetImageRetType, ok bool) { + return getMachineGetImageAttributeTypeOk(o.Image) } // SetImage sets field value -func (o *Machine) SetImage(v *Image) { - o.Image = v +func (o *Machine) SetImage(v MachineGetImageRetType) { + setMachineGetImageAttributeType(&o.Image, v) } // GetType returns the Type field value -func (o *Machine) GetType() *string { - if o == nil || IsNil(o.Type) { - var ret *string - return ret - } - - return o.Type +func (o *Machine) GetType() (ret MachineGetTypeRetType) { + 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 *Machine) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Type, true +func (o *Machine) GetTypeOk() (ret MachineGetTypeRetType, ok bool) { + return getMachineGetTypeAttributeTypeOk(o.Type) } // SetType sets field value -func (o *Machine) SetType(v *string) { - o.Type = v +func (o *Machine) SetType(v MachineGetTypeRetType) { + setMachineGetTypeAttributeType(&o.Type, v) } func (o Machine) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["image"] = o.Image - toSerialize["type"] = o.Type + if val, ok := getMachineGetImageAttributeTypeOk(o.Image); ok { + toSerialize["Image"] = val + } + if val, ok := getMachineGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } return toSerialize, nil } diff --git a/services/ske/model_machine_image.go b/services/ske/model_machine_image.go index a36194d6f..d0999c062 100644 --- a/services/ske/model_machine_image.go +++ b/services/ske/model_machine_image.go @@ -17,10 +17,51 @@ import ( // checks if the MachineImage type satisfies the MappedNullable interface at compile time var _ MappedNullable = &MachineImage{} +/* + types and functions for name +*/ + +// isNotNullableString +type MachineImageGetNameAttributeType = *string + +func getMachineImageGetNameAttributeTypeOk(arg MachineImageGetNameAttributeType) (ret MachineImageGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMachineImageGetNameAttributeType(arg *MachineImageGetNameAttributeType, val MachineImageGetNameRetType) { + *arg = &val +} + +type MachineImageGetNameArgType = string +type MachineImageGetNameRetType = string + +/* + types and functions for versions +*/ + +// isArray +type MachineImageGetVersionsAttributeType = *[]MachineImageVersion +type MachineImageGetVersionsArgType = []MachineImageVersion +type MachineImageGetVersionsRetType = []MachineImageVersion + +func getMachineImageGetVersionsAttributeTypeOk(arg MachineImageGetVersionsAttributeType) (ret MachineImageGetVersionsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMachineImageGetVersionsAttributeType(arg *MachineImageGetVersionsAttributeType, val MachineImageGetVersionsRetType) { + *arg = &val +} + // MachineImage struct for MachineImage type MachineImage struct { - Name *string `json:"name,omitempty"` - Versions *[]MachineImageVersion `json:"versions,omitempty"` + Name MachineImageGetNameAttributeType `json:"name,omitempty"` + Versions MachineImageGetVersionsAttributeType `json:"versions,omitempty"` } // NewMachineImage instantiates a new MachineImage object @@ -41,76 +82,58 @@ func NewMachineImageWithDefaults() *MachineImage { } // GetName returns the Name field value if set, zero value otherwise. -func (o *MachineImage) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *MachineImage) GetName() (res MachineImageGetNameRetType) { + 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 *MachineImage) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *MachineImage) GetNameOk() (ret MachineImageGetNameRetType, ok bool) { + return getMachineImageGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *MachineImage) 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 *MachineImage) SetName(v *string) { - o.Name = v +func (o *MachineImage) SetName(v MachineImageGetNameRetType) { + setMachineImageGetNameAttributeType(&o.Name, v) } // GetVersions returns the Versions field value if set, zero value otherwise. -func (o *MachineImage) GetVersions() *[]MachineImageVersion { - if o == nil || IsNil(o.Versions) { - var ret *[]MachineImageVersion - return ret - } - return o.Versions +func (o *MachineImage) GetVersions() (res MachineImageGetVersionsRetType) { + res, _ = o.GetVersionsOk() + return } // GetVersionsOk returns a tuple with the Versions field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MachineImage) GetVersionsOk() (*[]MachineImageVersion, bool) { - if o == nil || IsNil(o.Versions) { - return nil, false - } - return o.Versions, true +func (o *MachineImage) GetVersionsOk() (ret MachineImageGetVersionsRetType, ok bool) { + return getMachineImageGetVersionsAttributeTypeOk(o.Versions) } // HasVersions returns a boolean if a field has been set. func (o *MachineImage) HasVersions() bool { - if o != nil && !IsNil(o.Versions) { - return true - } - - return false + _, ok := o.GetVersionsOk() + return ok } // SetVersions gets a reference to the given []MachineImageVersion and assigns it to the Versions field. -func (o *MachineImage) SetVersions(v *[]MachineImageVersion) { - o.Versions = v +func (o *MachineImage) SetVersions(v MachineImageGetVersionsRetType) { + setMachineImageGetVersionsAttributeType(&o.Versions, v) } func (o MachineImage) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getMachineImageGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.Versions) { - toSerialize["versions"] = o.Versions + if val, ok := getMachineImageGetVersionsAttributeTypeOk(o.Versions); ok { + toSerialize["Versions"] = val } return toSerialize, nil } diff --git a/services/ske/model_machine_image_version.go b/services/ske/model_machine_image_version.go index ea606be9c..5d73e817c 100644 --- a/services/ske/model_machine_image_version.go +++ b/services/ske/model_machine_image_version.go @@ -18,12 +18,94 @@ import ( // checks if the MachineImageVersion type satisfies the MappedNullable interface at compile time var _ MappedNullable = &MachineImageVersion{} +/* + types and functions for cri +*/ + +// isArray +type MachineImageVersionGetCriAttributeType = *[]CRI +type MachineImageVersionGetCriArgType = []CRI +type MachineImageVersionGetCriRetType = []CRI + +func getMachineImageVersionGetCriAttributeTypeOk(arg MachineImageVersionGetCriAttributeType) (ret MachineImageVersionGetCriRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMachineImageVersionGetCriAttributeType(arg *MachineImageVersionGetCriAttributeType, val MachineImageVersionGetCriRetType) { + *arg = &val +} + +/* + types and functions for expirationDate +*/ + +// isDateTime +type MachineImageVersionGetExpirationDateAttributeType = *time.Time +type MachineImageVersionGetExpirationDateArgType = time.Time +type MachineImageVersionGetExpirationDateRetType = time.Time + +func getMachineImageVersionGetExpirationDateAttributeTypeOk(arg MachineImageVersionGetExpirationDateAttributeType) (ret MachineImageVersionGetExpirationDateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMachineImageVersionGetExpirationDateAttributeType(arg *MachineImageVersionGetExpirationDateAttributeType, val MachineImageVersionGetExpirationDateRetType) { + *arg = &val +} + +/* + types and functions for state +*/ + +// isNotNullableString +type MachineImageVersionGetStateAttributeType = *string + +func getMachineImageVersionGetStateAttributeTypeOk(arg MachineImageVersionGetStateAttributeType) (ret MachineImageVersionGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMachineImageVersionGetStateAttributeType(arg *MachineImageVersionGetStateAttributeType, val MachineImageVersionGetStateRetType) { + *arg = &val +} + +type MachineImageVersionGetStateArgType = string +type MachineImageVersionGetStateRetType = string + +/* + types and functions for version +*/ + +// isNotNullableString +type MachineImageVersionGetVersionAttributeType = *string + +func getMachineImageVersionGetVersionAttributeTypeOk(arg MachineImageVersionGetVersionAttributeType) (ret MachineImageVersionGetVersionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMachineImageVersionGetVersionAttributeType(arg *MachineImageVersionGetVersionAttributeType, val MachineImageVersionGetVersionRetType) { + *arg = &val +} + +type MachineImageVersionGetVersionArgType = string +type MachineImageVersionGetVersionRetType = string + // MachineImageVersion struct for MachineImageVersion type MachineImageVersion struct { - Cri *[]CRI `json:"cri,omitempty"` - ExpirationDate *time.Time `json:"expirationDate,omitempty"` - State *string `json:"state,omitempty"` - Version *string `json:"version,omitempty"` + Cri MachineImageVersionGetCriAttributeType `json:"cri,omitempty"` + ExpirationDate MachineImageVersionGetExpirationDateAttributeType `json:"expirationDate,omitempty"` + State MachineImageVersionGetStateAttributeType `json:"state,omitempty"` + Version MachineImageVersionGetVersionAttributeType `json:"version,omitempty"` } // NewMachineImageVersion instantiates a new MachineImageVersion object @@ -44,146 +126,110 @@ func NewMachineImageVersionWithDefaults() *MachineImageVersion { } // GetCri returns the Cri field value if set, zero value otherwise. -func (o *MachineImageVersion) GetCri() *[]CRI { - if o == nil || IsNil(o.Cri) { - var ret *[]CRI - return ret - } - return o.Cri +func (o *MachineImageVersion) GetCri() (res MachineImageVersionGetCriRetType) { + res, _ = o.GetCriOk() + return } // GetCriOk returns a tuple with the Cri field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MachineImageVersion) GetCriOk() (*[]CRI, bool) { - if o == nil || IsNil(o.Cri) { - return nil, false - } - return o.Cri, true +func (o *MachineImageVersion) GetCriOk() (ret MachineImageVersionGetCriRetType, ok bool) { + return getMachineImageVersionGetCriAttributeTypeOk(o.Cri) } // HasCri returns a boolean if a field has been set. func (o *MachineImageVersion) HasCri() bool { - if o != nil && !IsNil(o.Cri) { - return true - } - - return false + _, ok := o.GetCriOk() + return ok } // SetCri gets a reference to the given []CRI and assigns it to the Cri field. -func (o *MachineImageVersion) SetCri(v *[]CRI) { - o.Cri = v +func (o *MachineImageVersion) SetCri(v MachineImageVersionGetCriRetType) { + setMachineImageVersionGetCriAttributeType(&o.Cri, v) } // GetExpirationDate returns the ExpirationDate field value if set, zero value otherwise. -func (o *MachineImageVersion) GetExpirationDate() *time.Time { - if o == nil || IsNil(o.ExpirationDate) { - var ret *time.Time - return ret - } - return o.ExpirationDate +func (o *MachineImageVersion) GetExpirationDate() (res MachineImageVersionGetExpirationDateRetType) { + res, _ = o.GetExpirationDateOk() + return } // GetExpirationDateOk returns a tuple with the ExpirationDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MachineImageVersion) GetExpirationDateOk() (*time.Time, bool) { - if o == nil || IsNil(o.ExpirationDate) { - return nil, false - } - return o.ExpirationDate, true +func (o *MachineImageVersion) GetExpirationDateOk() (ret MachineImageVersionGetExpirationDateRetType, ok bool) { + return getMachineImageVersionGetExpirationDateAttributeTypeOk(o.ExpirationDate) } // HasExpirationDate returns a boolean if a field has been set. func (o *MachineImageVersion) HasExpirationDate() bool { - if o != nil && !IsNil(o.ExpirationDate) { - return true - } - - return false + _, ok := o.GetExpirationDateOk() + return ok } // SetExpirationDate gets a reference to the given time.Time and assigns it to the ExpirationDate field. -func (o *MachineImageVersion) SetExpirationDate(v *time.Time) { - o.ExpirationDate = v +func (o *MachineImageVersion) SetExpirationDate(v MachineImageVersionGetExpirationDateRetType) { + setMachineImageVersionGetExpirationDateAttributeType(&o.ExpirationDate, v) } // GetState returns the State field value if set, zero value otherwise. -func (o *MachineImageVersion) GetState() *string { - if o == nil || IsNil(o.State) { - var ret *string - return ret - } - return o.State +func (o *MachineImageVersion) GetState() (res MachineImageVersionGetStateRetType) { + res, _ = o.GetStateOk() + return } // GetStateOk returns a tuple with the State field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MachineImageVersion) GetStateOk() (*string, bool) { - if o == nil || IsNil(o.State) { - return nil, false - } - return o.State, true +func (o *MachineImageVersion) GetStateOk() (ret MachineImageVersionGetStateRetType, ok bool) { + return getMachineImageVersionGetStateAttributeTypeOk(o.State) } // HasState returns a boolean if a field has been set. func (o *MachineImageVersion) HasState() bool { - if o != nil && !IsNil(o.State) { - return true - } - - return false + _, ok := o.GetStateOk() + return ok } // SetState gets a reference to the given string and assigns it to the State field. -func (o *MachineImageVersion) SetState(v *string) { - o.State = v +func (o *MachineImageVersion) SetState(v MachineImageVersionGetStateRetType) { + setMachineImageVersionGetStateAttributeType(&o.State, v) } // GetVersion returns the Version field value if set, zero value otherwise. -func (o *MachineImageVersion) GetVersion() *string { - if o == nil || IsNil(o.Version) { - var ret *string - return ret - } - return o.Version +func (o *MachineImageVersion) GetVersion() (res MachineImageVersionGetVersionRetType) { + res, _ = o.GetVersionOk() + return } // GetVersionOk returns a tuple with the Version field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MachineImageVersion) GetVersionOk() (*string, bool) { - if o == nil || IsNil(o.Version) { - return nil, false - } - return o.Version, true +func (o *MachineImageVersion) GetVersionOk() (ret MachineImageVersionGetVersionRetType, ok bool) { + return getMachineImageVersionGetVersionAttributeTypeOk(o.Version) } // HasVersion returns a boolean if a field has been set. func (o *MachineImageVersion) HasVersion() bool { - if o != nil && !IsNil(o.Version) { - return true - } - - return false + _, ok := o.GetVersionOk() + return ok } // SetVersion gets a reference to the given string and assigns it to the Version field. -func (o *MachineImageVersion) SetVersion(v *string) { - o.Version = v +func (o *MachineImageVersion) SetVersion(v MachineImageVersionGetVersionRetType) { + setMachineImageVersionGetVersionAttributeType(&o.Version, v) } func (o MachineImageVersion) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Cri) { - toSerialize["cri"] = o.Cri + if val, ok := getMachineImageVersionGetCriAttributeTypeOk(o.Cri); ok { + toSerialize["Cri"] = val } - if !IsNil(o.ExpirationDate) { - toSerialize["expirationDate"] = o.ExpirationDate + if val, ok := getMachineImageVersionGetExpirationDateAttributeTypeOk(o.ExpirationDate); ok { + toSerialize["ExpirationDate"] = val } - if !IsNil(o.State) { - toSerialize["state"] = o.State + if val, ok := getMachineImageVersionGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val } - if !IsNil(o.Version) { - toSerialize["version"] = o.Version + if val, ok := getMachineImageVersionGetVersionAttributeTypeOk(o.Version); ok { + toSerialize["Version"] = val } return toSerialize, nil } diff --git a/services/ske/model_machine_type.go b/services/ske/model_machine_type.go index 191cfa24a..090290cb3 100644 --- a/services/ske/model_machine_type.go +++ b/services/ske/model_machine_type.go @@ -17,16 +17,118 @@ import ( // checks if the MachineType type satisfies the MappedNullable interface at compile time var _ MappedNullable = &MachineType{} +/* + types and functions for architecture +*/ + +// isNotNullableString +type MachineTypeGetArchitectureAttributeType = *string + +func getMachineTypeGetArchitectureAttributeTypeOk(arg MachineTypeGetArchitectureAttributeType) (ret MachineTypeGetArchitectureRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMachineTypeGetArchitectureAttributeType(arg *MachineTypeGetArchitectureAttributeType, val MachineTypeGetArchitectureRetType) { + *arg = &val +} + +type MachineTypeGetArchitectureArgType = string +type MachineTypeGetArchitectureRetType = string + +/* + types and functions for cpu +*/ + +// isInteger +type MachineTypeGetCpuAttributeType = *int64 +type MachineTypeGetCpuArgType = int64 +type MachineTypeGetCpuRetType = int64 + +func getMachineTypeGetCpuAttributeTypeOk(arg MachineTypeGetCpuAttributeType) (ret MachineTypeGetCpuRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMachineTypeGetCpuAttributeType(arg *MachineTypeGetCpuAttributeType, val MachineTypeGetCpuRetType) { + *arg = &val +} + +/* + types and functions for gpu +*/ + +// isInteger +type MachineTypeGetGpuAttributeType = *int64 +type MachineTypeGetGpuArgType = int64 +type MachineTypeGetGpuRetType = int64 + +func getMachineTypeGetGpuAttributeTypeOk(arg MachineTypeGetGpuAttributeType) (ret MachineTypeGetGpuRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMachineTypeGetGpuAttributeType(arg *MachineTypeGetGpuAttributeType, val MachineTypeGetGpuRetType) { + *arg = &val +} + +/* + types and functions for memory +*/ + +// isInteger +type MachineTypeGetMemoryAttributeType = *int64 +type MachineTypeGetMemoryArgType = int64 +type MachineTypeGetMemoryRetType = int64 + +func getMachineTypeGetMemoryAttributeTypeOk(arg MachineTypeGetMemoryAttributeType) (ret MachineTypeGetMemoryRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMachineTypeGetMemoryAttributeType(arg *MachineTypeGetMemoryAttributeType, val MachineTypeGetMemoryRetType) { + *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 + // MachineType struct for MachineType type MachineType struct { - Architecture *string `json:"architecture,omitempty"` + Architecture MachineTypeGetArchitectureAttributeType `json:"architecture,omitempty"` // Can be cast to int32 without loss of precision. - Cpu *int64 `json:"cpu,omitempty"` + Cpu MachineTypeGetCpuAttributeType `json:"cpu,omitempty"` // Can be cast to int32 without loss of precision. - Gpu *int64 `json:"gpu,omitempty"` + Gpu MachineTypeGetGpuAttributeType `json:"gpu,omitempty"` // Can be cast to int32 without loss of precision. - Memory *int64 `json:"memory,omitempty"` - Name *string `json:"name,omitempty"` + Memory MachineTypeGetMemoryAttributeType `json:"memory,omitempty"` + Name MachineTypeGetNameAttributeType `json:"name,omitempty"` } // NewMachineType instantiates a new MachineType object @@ -47,181 +149,136 @@ func NewMachineTypeWithDefaults() *MachineType { } // GetArchitecture returns the Architecture field value if set, zero value otherwise. -func (o *MachineType) GetArchitecture() *string { - if o == nil || IsNil(o.Architecture) { - var ret *string - return ret - } - return o.Architecture +func (o *MachineType) GetArchitecture() (res MachineTypeGetArchitectureRetType) { + 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 *MachineType) GetArchitectureOk() (*string, bool) { - if o == nil || IsNil(o.Architecture) { - return nil, false - } - return o.Architecture, true +func (o *MachineType) GetArchitectureOk() (ret MachineTypeGetArchitectureRetType, ok bool) { + return getMachineTypeGetArchitectureAttributeTypeOk(o.Architecture) } // HasArchitecture returns a boolean if a field has been set. func (o *MachineType) 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 *MachineType) SetArchitecture(v *string) { - o.Architecture = v +func (o *MachineType) SetArchitecture(v MachineTypeGetArchitectureRetType) { + setMachineTypeGetArchitectureAttributeType(&o.Architecture, v) } // GetCpu returns the Cpu field value if set, zero value otherwise. -func (o *MachineType) GetCpu() *int64 { - if o == nil || IsNil(o.Cpu) { - var ret *int64 - return ret - } - return o.Cpu +func (o *MachineType) GetCpu() (res MachineTypeGetCpuRetType) { + res, _ = o.GetCpuOk() + return } // GetCpuOk returns a tuple with the Cpu field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MachineType) GetCpuOk() (*int64, bool) { - if o == nil || IsNil(o.Cpu) { - return nil, false - } - return o.Cpu, true +func (o *MachineType) GetCpuOk() (ret MachineTypeGetCpuRetType, ok bool) { + return getMachineTypeGetCpuAttributeTypeOk(o.Cpu) } // HasCpu returns a boolean if a field has been set. func (o *MachineType) HasCpu() bool { - if o != nil && !IsNil(o.Cpu) { - return true - } - - return false + _, ok := o.GetCpuOk() + return ok } // SetCpu gets a reference to the given int64 and assigns it to the Cpu field. -func (o *MachineType) SetCpu(v *int64) { - o.Cpu = v +func (o *MachineType) SetCpu(v MachineTypeGetCpuRetType) { + setMachineTypeGetCpuAttributeType(&o.Cpu, v) } // GetGpu returns the Gpu field value if set, zero value otherwise. -func (o *MachineType) GetGpu() *int64 { - if o == nil || IsNil(o.Gpu) { - var ret *int64 - return ret - } - return o.Gpu +func (o *MachineType) GetGpu() (res MachineTypeGetGpuRetType) { + res, _ = o.GetGpuOk() + return } // GetGpuOk returns a tuple with the Gpu field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MachineType) GetGpuOk() (*int64, bool) { - if o == nil || IsNil(o.Gpu) { - return nil, false - } - return o.Gpu, true +func (o *MachineType) GetGpuOk() (ret MachineTypeGetGpuRetType, ok bool) { + return getMachineTypeGetGpuAttributeTypeOk(o.Gpu) } // HasGpu returns a boolean if a field has been set. func (o *MachineType) HasGpu() bool { - if o != nil && !IsNil(o.Gpu) { - return true - } - - return false + _, ok := o.GetGpuOk() + return ok } // SetGpu gets a reference to the given int64 and assigns it to the Gpu field. -func (o *MachineType) SetGpu(v *int64) { - o.Gpu = v +func (o *MachineType) SetGpu(v MachineTypeGetGpuRetType) { + setMachineTypeGetGpuAttributeType(&o.Gpu, v) } // GetMemory returns the Memory field value if set, zero value otherwise. -func (o *MachineType) GetMemory() *int64 { - if o == nil || IsNil(o.Memory) { - var ret *int64 - return ret - } - return o.Memory +func (o *MachineType) GetMemory() (res MachineTypeGetMemoryRetType) { + res, _ = o.GetMemoryOk() + return } // GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MachineType) GetMemoryOk() (*int64, bool) { - if o == nil || IsNil(o.Memory) { - return nil, false - } - return o.Memory, true +func (o *MachineType) GetMemoryOk() (ret MachineTypeGetMemoryRetType, ok bool) { + return getMachineTypeGetMemoryAttributeTypeOk(o.Memory) } // HasMemory returns a boolean if a field has been set. func (o *MachineType) HasMemory() bool { - if o != nil && !IsNil(o.Memory) { - return true - } - - return false + _, ok := o.GetMemoryOk() + return ok } // SetMemory gets a reference to the given int64 and assigns it to the Memory field. -func (o *MachineType) SetMemory(v *int64) { - o.Memory = v +func (o *MachineType) SetMemory(v MachineTypeGetMemoryRetType) { + setMachineTypeGetMemoryAttributeType(&o.Memory, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *MachineType) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *MachineType) GetName() (res MachineTypeGetNameRetType) { + 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 *MachineType) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *MachineType) GetNameOk() (ret MachineTypeGetNameRetType, ok bool) { + return getMachineTypeGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *MachineType) 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 *MachineType) SetName(v *string) { - o.Name = v +func (o *MachineType) SetName(v MachineTypeGetNameRetType) { + setMachineTypeGetNameAttributeType(&o.Name, v) } func (o MachineType) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Architecture) { - toSerialize["architecture"] = o.Architecture + if val, ok := getMachineTypeGetArchitectureAttributeTypeOk(o.Architecture); ok { + toSerialize["Architecture"] = val } - if !IsNil(o.Cpu) { - toSerialize["cpu"] = o.Cpu + if val, ok := getMachineTypeGetCpuAttributeTypeOk(o.Cpu); ok { + toSerialize["Cpu"] = val } - if !IsNil(o.Gpu) { - toSerialize["gpu"] = o.Gpu + if val, ok := getMachineTypeGetGpuAttributeTypeOk(o.Gpu); ok { + toSerialize["Gpu"] = val } - if !IsNil(o.Memory) { - toSerialize["memory"] = o.Memory + if val, ok := getMachineTypeGetMemoryAttributeTypeOk(o.Memory); ok { + toSerialize["Memory"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getMachineTypeGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } return toSerialize, nil } diff --git a/services/ske/model_maintenance.go b/services/ske/model_maintenance.go index 78dcd7adf..a7fd55558 100644 --- a/services/ske/model_maintenance.go +++ b/services/ske/model_maintenance.go @@ -17,12 +17,52 @@ import ( // checks if the Maintenance type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Maintenance{} +/* + types and functions for autoUpdate +*/ + +// isModel +type MaintenanceGetAutoUpdateAttributeType = *MaintenanceAutoUpdate +type MaintenanceGetAutoUpdateArgType = MaintenanceAutoUpdate +type MaintenanceGetAutoUpdateRetType = MaintenanceAutoUpdate + +func getMaintenanceGetAutoUpdateAttributeTypeOk(arg MaintenanceGetAutoUpdateAttributeType) (ret MaintenanceGetAutoUpdateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMaintenanceGetAutoUpdateAttributeType(arg *MaintenanceGetAutoUpdateAttributeType, val MaintenanceGetAutoUpdateRetType) { + *arg = &val +} + +/* + types and functions for timeWindow +*/ + +// isModel +type MaintenanceGetTimeWindowAttributeType = *TimeWindow +type MaintenanceGetTimeWindowArgType = TimeWindow +type MaintenanceGetTimeWindowRetType = TimeWindow + +func getMaintenanceGetTimeWindowAttributeTypeOk(arg MaintenanceGetTimeWindowAttributeType) (ret MaintenanceGetTimeWindowRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMaintenanceGetTimeWindowAttributeType(arg *MaintenanceGetTimeWindowAttributeType, val MaintenanceGetTimeWindowRetType) { + *arg = &val +} + // Maintenance struct for Maintenance type Maintenance struct { // REQUIRED - AutoUpdate *MaintenanceAutoUpdate `json:"autoUpdate"` + AutoUpdate MaintenanceGetAutoUpdateAttributeType `json:"autoUpdate"` // REQUIRED - TimeWindow *TimeWindow `json:"timeWindow"` + TimeWindow MaintenanceGetTimeWindowAttributeType `json:"timeWindow"` } type _Maintenance Maintenance @@ -31,10 +71,10 @@ type _Maintenance Maintenance // 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 NewMaintenance(autoUpdate *MaintenanceAutoUpdate, timeWindow *TimeWindow) *Maintenance { +func NewMaintenance(autoUpdate MaintenanceGetAutoUpdateArgType, timeWindow MaintenanceGetTimeWindowArgType) *Maintenance { this := Maintenance{} - this.AutoUpdate = autoUpdate - this.TimeWindow = timeWindow + setMaintenanceGetAutoUpdateAttributeType(&this.AutoUpdate, autoUpdate) + setMaintenanceGetTimeWindowAttributeType(&this.TimeWindow, timeWindow) return &this } @@ -47,57 +87,47 @@ func NewMaintenanceWithDefaults() *Maintenance { } // GetAutoUpdate returns the AutoUpdate field value -func (o *Maintenance) GetAutoUpdate() *MaintenanceAutoUpdate { - if o == nil || IsNil(o.AutoUpdate) { - var ret *MaintenanceAutoUpdate - return ret - } - - return o.AutoUpdate +func (o *Maintenance) GetAutoUpdate() (ret MaintenanceGetAutoUpdateRetType) { + ret, _ = o.GetAutoUpdateOk() + return ret } // GetAutoUpdateOk returns a tuple with the AutoUpdate field value // and a boolean to check if the value has been set. -func (o *Maintenance) GetAutoUpdateOk() (*MaintenanceAutoUpdate, bool) { - if o == nil { - return nil, false - } - return o.AutoUpdate, true +func (o *Maintenance) GetAutoUpdateOk() (ret MaintenanceGetAutoUpdateRetType, ok bool) { + return getMaintenanceGetAutoUpdateAttributeTypeOk(o.AutoUpdate) } // SetAutoUpdate sets field value -func (o *Maintenance) SetAutoUpdate(v *MaintenanceAutoUpdate) { - o.AutoUpdate = v +func (o *Maintenance) SetAutoUpdate(v MaintenanceGetAutoUpdateRetType) { + setMaintenanceGetAutoUpdateAttributeType(&o.AutoUpdate, v) } // GetTimeWindow returns the TimeWindow field value -func (o *Maintenance) GetTimeWindow() *TimeWindow { - if o == nil || IsNil(o.TimeWindow) { - var ret *TimeWindow - return ret - } - - return o.TimeWindow +func (o *Maintenance) GetTimeWindow() (ret MaintenanceGetTimeWindowRetType) { + ret, _ = o.GetTimeWindowOk() + return ret } // GetTimeWindowOk returns a tuple with the TimeWindow field value // and a boolean to check if the value has been set. -func (o *Maintenance) GetTimeWindowOk() (*TimeWindow, bool) { - if o == nil { - return nil, false - } - return o.TimeWindow, true +func (o *Maintenance) GetTimeWindowOk() (ret MaintenanceGetTimeWindowRetType, ok bool) { + return getMaintenanceGetTimeWindowAttributeTypeOk(o.TimeWindow) } // SetTimeWindow sets field value -func (o *Maintenance) SetTimeWindow(v *TimeWindow) { - o.TimeWindow = v +func (o *Maintenance) SetTimeWindow(v MaintenanceGetTimeWindowRetType) { + setMaintenanceGetTimeWindowAttributeType(&o.TimeWindow, v) } func (o Maintenance) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["autoUpdate"] = o.AutoUpdate - toSerialize["timeWindow"] = o.TimeWindow + if val, ok := getMaintenanceGetAutoUpdateAttributeTypeOk(o.AutoUpdate); ok { + toSerialize["AutoUpdate"] = val + } + if val, ok := getMaintenanceGetTimeWindowAttributeTypeOk(o.TimeWindow); ok { + toSerialize["TimeWindow"] = val + } return toSerialize, nil } diff --git a/services/ske/model_maintenance_auto_update.go b/services/ske/model_maintenance_auto_update.go index d9d4dfc00..925303a04 100644 --- a/services/ske/model_maintenance_auto_update.go +++ b/services/ske/model_maintenance_auto_update.go @@ -17,10 +17,50 @@ import ( // checks if the MaintenanceAutoUpdate type satisfies the MappedNullable interface at compile time var _ MappedNullable = &MaintenanceAutoUpdate{} +/* + types and functions for kubernetesVersion +*/ + +// isBoolean +type MaintenanceAutoUpdategetKubernetesVersionAttributeType = *bool +type MaintenanceAutoUpdategetKubernetesVersionArgType = bool +type MaintenanceAutoUpdategetKubernetesVersionRetType = bool + +func getMaintenanceAutoUpdategetKubernetesVersionAttributeTypeOk(arg MaintenanceAutoUpdategetKubernetesVersionAttributeType) (ret MaintenanceAutoUpdategetKubernetesVersionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMaintenanceAutoUpdategetKubernetesVersionAttributeType(arg *MaintenanceAutoUpdategetKubernetesVersionAttributeType, val MaintenanceAutoUpdategetKubernetesVersionRetType) { + *arg = &val +} + +/* + types and functions for machineImageVersion +*/ + +// isBoolean +type MaintenanceAutoUpdategetMachineImageVersionAttributeType = *bool +type MaintenanceAutoUpdategetMachineImageVersionArgType = bool +type MaintenanceAutoUpdategetMachineImageVersionRetType = bool + +func getMaintenanceAutoUpdategetMachineImageVersionAttributeTypeOk(arg MaintenanceAutoUpdategetMachineImageVersionAttributeType) (ret MaintenanceAutoUpdategetMachineImageVersionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMaintenanceAutoUpdategetMachineImageVersionAttributeType(arg *MaintenanceAutoUpdategetMachineImageVersionAttributeType, val MaintenanceAutoUpdategetMachineImageVersionRetType) { + *arg = &val +} + // MaintenanceAutoUpdate struct for MaintenanceAutoUpdate type MaintenanceAutoUpdate struct { - KubernetesVersion *bool `json:"kubernetesVersion,omitempty"` - MachineImageVersion *bool `json:"machineImageVersion,omitempty"` + KubernetesVersion MaintenanceAutoUpdategetKubernetesVersionAttributeType `json:"kubernetesVersion,omitempty"` + MachineImageVersion MaintenanceAutoUpdategetMachineImageVersionAttributeType `json:"machineImageVersion,omitempty"` } // NewMaintenanceAutoUpdate instantiates a new MaintenanceAutoUpdate object @@ -41,76 +81,58 @@ func NewMaintenanceAutoUpdateWithDefaults() *MaintenanceAutoUpdate { } // GetKubernetesVersion returns the KubernetesVersion field value if set, zero value otherwise. -func (o *MaintenanceAutoUpdate) GetKubernetesVersion() *bool { - if o == nil || IsNil(o.KubernetesVersion) { - var ret *bool - return ret - } - return o.KubernetesVersion +func (o *MaintenanceAutoUpdate) GetKubernetesVersion() (res MaintenanceAutoUpdategetKubernetesVersionRetType) { + res, _ = o.GetKubernetesVersionOk() + return } // GetKubernetesVersionOk returns a tuple with the KubernetesVersion field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MaintenanceAutoUpdate) GetKubernetesVersionOk() (*bool, bool) { - if o == nil || IsNil(o.KubernetesVersion) { - return nil, false - } - return o.KubernetesVersion, true +func (o *MaintenanceAutoUpdate) GetKubernetesVersionOk() (ret MaintenanceAutoUpdategetKubernetesVersionRetType, ok bool) { + return getMaintenanceAutoUpdategetKubernetesVersionAttributeTypeOk(o.KubernetesVersion) } // HasKubernetesVersion returns a boolean if a field has been set. func (o *MaintenanceAutoUpdate) HasKubernetesVersion() bool { - if o != nil && !IsNil(o.KubernetesVersion) { - return true - } - - return false + _, ok := o.GetKubernetesVersionOk() + return ok } // SetKubernetesVersion gets a reference to the given bool and assigns it to the KubernetesVersion field. -func (o *MaintenanceAutoUpdate) SetKubernetesVersion(v *bool) { - o.KubernetesVersion = v +func (o *MaintenanceAutoUpdate) SetKubernetesVersion(v MaintenanceAutoUpdategetKubernetesVersionRetType) { + setMaintenanceAutoUpdategetKubernetesVersionAttributeType(&o.KubernetesVersion, v) } // GetMachineImageVersion returns the MachineImageVersion field value if set, zero value otherwise. -func (o *MaintenanceAutoUpdate) GetMachineImageVersion() *bool { - if o == nil || IsNil(o.MachineImageVersion) { - var ret *bool - return ret - } - return o.MachineImageVersion +func (o *MaintenanceAutoUpdate) GetMachineImageVersion() (res MaintenanceAutoUpdategetMachineImageVersionRetType) { + res, _ = o.GetMachineImageVersionOk() + return } // GetMachineImageVersionOk returns a tuple with the MachineImageVersion field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MaintenanceAutoUpdate) GetMachineImageVersionOk() (*bool, bool) { - if o == nil || IsNil(o.MachineImageVersion) { - return nil, false - } - return o.MachineImageVersion, true +func (o *MaintenanceAutoUpdate) GetMachineImageVersionOk() (ret MaintenanceAutoUpdategetMachineImageVersionRetType, ok bool) { + return getMaintenanceAutoUpdategetMachineImageVersionAttributeTypeOk(o.MachineImageVersion) } // HasMachineImageVersion returns a boolean if a field has been set. func (o *MaintenanceAutoUpdate) HasMachineImageVersion() bool { - if o != nil && !IsNil(o.MachineImageVersion) { - return true - } - - return false + _, ok := o.GetMachineImageVersionOk() + return ok } // SetMachineImageVersion gets a reference to the given bool and assigns it to the MachineImageVersion field. -func (o *MaintenanceAutoUpdate) SetMachineImageVersion(v *bool) { - o.MachineImageVersion = v +func (o *MaintenanceAutoUpdate) SetMachineImageVersion(v MaintenanceAutoUpdategetMachineImageVersionRetType) { + setMaintenanceAutoUpdategetMachineImageVersionAttributeType(&o.MachineImageVersion, v) } func (o MaintenanceAutoUpdate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.KubernetesVersion) { - toSerialize["kubernetesVersion"] = o.KubernetesVersion + if val, ok := getMaintenanceAutoUpdategetKubernetesVersionAttributeTypeOk(o.KubernetesVersion); ok { + toSerialize["KubernetesVersion"] = val } - if !IsNil(o.MachineImageVersion) { - toSerialize["machineImageVersion"] = o.MachineImageVersion + if val, ok := getMaintenanceAutoUpdategetMachineImageVersionAttributeTypeOk(o.MachineImageVersion); ok { + toSerialize["MachineImageVersion"] = val } return toSerialize, nil } diff --git a/services/ske/model_network.go b/services/ske/model_network.go index e07afe096..f8fabf55b 100644 --- a/services/ske/model_network.go +++ b/services/ske/model_network.go @@ -17,9 +17,30 @@ import ( // checks if the Network type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Network{} +/* + types and functions for id +*/ + +// isNotNullableString +type NetworkGetIdAttributeType = *string + +func getNetworkGetIdAttributeTypeOk(arg NetworkGetIdAttributeType) (ret NetworkGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkGetIdAttributeType(arg *NetworkGetIdAttributeType, val NetworkGetIdRetType) { + *arg = &val +} + +type NetworkGetIdArgType = string +type NetworkGetIdRetType = string + // Network struct for Network type Network struct { - Id *string `json:"id,omitempty"` + Id NetworkGetIdAttributeType `json:"id,omitempty"` } // NewNetwork instantiates a new Network object @@ -40,41 +61,32 @@ func NewNetworkWithDefaults() *Network { } // GetId returns the Id field value if set, zero value otherwise. -func (o *Network) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *Network) GetId() (res NetworkGetIdRetType) { + 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 *Network) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *Network) GetIdOk() (ret NetworkGetIdRetType, ok bool) { + return getNetworkGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *Network) 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 *Network) SetId(v *string) { - o.Id = v +func (o *Network) SetId(v NetworkGetIdRetType) { + setNetworkGetIdAttributeType(&o.Id, v) } func (o Network) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getNetworkGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } return toSerialize, nil } diff --git a/services/ske/model_nodepool.go b/services/ske/model_nodepool.go index 8c9bbc510..a31c30a06 100644 --- a/services/ske/model_nodepool.go +++ b/services/ske/model_nodepool.go @@ -17,34 +17,275 @@ import ( // checks if the Nodepool type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Nodepool{} +/* + types and functions for allowSystemComponents +*/ + +// isBoolean +type NodepoolgetAllowSystemComponentsAttributeType = *bool +type NodepoolgetAllowSystemComponentsArgType = bool +type NodepoolgetAllowSystemComponentsRetType = bool + +func getNodepoolgetAllowSystemComponentsAttributeTypeOk(arg NodepoolgetAllowSystemComponentsAttributeType) (ret NodepoolgetAllowSystemComponentsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNodepoolgetAllowSystemComponentsAttributeType(arg *NodepoolgetAllowSystemComponentsAttributeType, val NodepoolgetAllowSystemComponentsRetType) { + *arg = &val +} + +/* + types and functions for availabilityZones +*/ + +// isArray +type NodepoolGetAvailabilityZonesAttributeType = *[]string +type NodepoolGetAvailabilityZonesArgType = []string +type NodepoolGetAvailabilityZonesRetType = []string + +func getNodepoolGetAvailabilityZonesAttributeTypeOk(arg NodepoolGetAvailabilityZonesAttributeType) (ret NodepoolGetAvailabilityZonesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNodepoolGetAvailabilityZonesAttributeType(arg *NodepoolGetAvailabilityZonesAttributeType, val NodepoolGetAvailabilityZonesRetType) { + *arg = &val +} + +/* + types and functions for cri +*/ + +// isModel +type NodepoolGetCriAttributeType = *CRI +type NodepoolGetCriArgType = CRI +type NodepoolGetCriRetType = CRI + +func getNodepoolGetCriAttributeTypeOk(arg NodepoolGetCriAttributeType) (ret NodepoolGetCriRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNodepoolGetCriAttributeType(arg *NodepoolGetCriAttributeType, val NodepoolGetCriRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isContainer +type NodepoolGetLabelsAttributeType = *map[string]string +type NodepoolGetLabelsArgType = map[string]string +type NodepoolGetLabelsRetType = map[string]string + +func getNodepoolGetLabelsAttributeTypeOk(arg NodepoolGetLabelsAttributeType) (ret NodepoolGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNodepoolGetLabelsAttributeType(arg *NodepoolGetLabelsAttributeType, val NodepoolGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for machine +*/ + +// isModel +type NodepoolGetMachineAttributeType = *Machine +type NodepoolGetMachineArgType = Machine +type NodepoolGetMachineRetType = Machine + +func getNodepoolGetMachineAttributeTypeOk(arg NodepoolGetMachineAttributeType) (ret NodepoolGetMachineRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNodepoolGetMachineAttributeType(arg *NodepoolGetMachineAttributeType, val NodepoolGetMachineRetType) { + *arg = &val +} + +/* + types and functions for maxSurge +*/ + +// isInteger +type NodepoolGetMaxSurgeAttributeType = *int64 +type NodepoolGetMaxSurgeArgType = int64 +type NodepoolGetMaxSurgeRetType = int64 + +func getNodepoolGetMaxSurgeAttributeTypeOk(arg NodepoolGetMaxSurgeAttributeType) (ret NodepoolGetMaxSurgeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNodepoolGetMaxSurgeAttributeType(arg *NodepoolGetMaxSurgeAttributeType, val NodepoolGetMaxSurgeRetType) { + *arg = &val +} + +/* + types and functions for maxUnavailable +*/ + +// isInteger +type NodepoolGetMaxUnavailableAttributeType = *int64 +type NodepoolGetMaxUnavailableArgType = int64 +type NodepoolGetMaxUnavailableRetType = int64 + +func getNodepoolGetMaxUnavailableAttributeTypeOk(arg NodepoolGetMaxUnavailableAttributeType) (ret NodepoolGetMaxUnavailableRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNodepoolGetMaxUnavailableAttributeType(arg *NodepoolGetMaxUnavailableAttributeType, val NodepoolGetMaxUnavailableRetType) { + *arg = &val +} + +/* + types and functions for maximum +*/ + +// isInteger +type NodepoolGetMaximumAttributeType = *int64 +type NodepoolGetMaximumArgType = int64 +type NodepoolGetMaximumRetType = int64 + +func getNodepoolGetMaximumAttributeTypeOk(arg NodepoolGetMaximumAttributeType) (ret NodepoolGetMaximumRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNodepoolGetMaximumAttributeType(arg *NodepoolGetMaximumAttributeType, val NodepoolGetMaximumRetType) { + *arg = &val +} + +/* + types and functions for minimum +*/ + +// isInteger +type NodepoolGetMinimumAttributeType = *int64 +type NodepoolGetMinimumArgType = int64 +type NodepoolGetMinimumRetType = int64 + +func getNodepoolGetMinimumAttributeTypeOk(arg NodepoolGetMinimumAttributeType) (ret NodepoolGetMinimumRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNodepoolGetMinimumAttributeType(arg *NodepoolGetMinimumAttributeType, val NodepoolGetMinimumRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type NodepoolGetNameAttributeType = *string + +func getNodepoolGetNameAttributeTypeOk(arg NodepoolGetNameAttributeType) (ret NodepoolGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNodepoolGetNameAttributeType(arg *NodepoolGetNameAttributeType, val NodepoolGetNameRetType) { + *arg = &val +} + +type NodepoolGetNameArgType = string +type NodepoolGetNameRetType = string + +/* + types and functions for taints +*/ + +// isArray +type NodepoolGetTaintsAttributeType = *[]Taint +type NodepoolGetTaintsArgType = []Taint +type NodepoolGetTaintsRetType = []Taint + +func getNodepoolGetTaintsAttributeTypeOk(arg NodepoolGetTaintsAttributeType) (ret NodepoolGetTaintsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNodepoolGetTaintsAttributeType(arg *NodepoolGetTaintsAttributeType, val NodepoolGetTaintsRetType) { + *arg = &val +} + +/* + types and functions for volume +*/ + +// isModel +type NodepoolGetVolumeAttributeType = *Volume +type NodepoolGetVolumeArgType = Volume +type NodepoolGetVolumeRetType = Volume + +func getNodepoolGetVolumeAttributeTypeOk(arg NodepoolGetVolumeAttributeType) (ret NodepoolGetVolumeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNodepoolGetVolumeAttributeType(arg *NodepoolGetVolumeAttributeType, val NodepoolGetVolumeRetType) { + *arg = &val +} + // Nodepool struct for Nodepool type Nodepool struct { // This needs to be true for at least one node pool. - AllowSystemComponents *bool `json:"allowSystemComponents,omitempty"` + AllowSystemComponents NodepoolgetAllowSystemComponentsAttributeType `json:"allowSystemComponents,omitempty"` // REQUIRED - AvailabilityZones *[]string `json:"availabilityZones"` - Cri *CRI `json:"cri,omitempty"` - Labels *map[string]string `json:"labels,omitempty"` + AvailabilityZones NodepoolGetAvailabilityZonesAttributeType `json:"availabilityZones"` + Cri NodepoolGetCriAttributeType `json:"cri,omitempty"` + Labels NodepoolGetLabelsAttributeType `json:"labels,omitempty"` // REQUIRED - Machine *Machine `json:"machine"` + Machine NodepoolGetMachineAttributeType `json:"machine"` // Can be cast to int32 without loss of precision. - MaxSurge *int64 `json:"maxSurge,omitempty"` + MaxSurge NodepoolGetMaxSurgeAttributeType `json:"maxSurge,omitempty"` // Can be cast to int32 without loss of precision. - MaxUnavailable *int64 `json:"maxUnavailable,omitempty"` + MaxUnavailable NodepoolGetMaxUnavailableAttributeType `json:"maxUnavailable,omitempty"` // Maximum number of nodes in the pool. During runtime, the cluster will never scale beyond 1000 nodes, even if the total maximum would allow for a larger cluster. // Can be cast to int32 without loss of precision. // REQUIRED - Maximum *int64 `json:"maximum"` + Maximum NodepoolGetMaximumAttributeType `json:"maximum"` // Minimum number of nodes in the pool. The sum of all minima must not exceed 1000. // Can be cast to int32 without loss of precision. // REQUIRED - Minimum *int64 `json:"minimum"` + Minimum NodepoolGetMinimumAttributeType `json:"minimum"` // Maximum 15 chars // REQUIRED - Name *string `json:"name"` - Taints *[]Taint `json:"taints,omitempty"` + Name NodepoolGetNameAttributeType `json:"name"` + Taints NodepoolGetTaintsAttributeType `json:"taints,omitempty"` // REQUIRED - Volume *Volume `json:"volume"` + Volume NodepoolGetVolumeAttributeType `json:"volume"` } type _Nodepool Nodepool @@ -53,14 +294,14 @@ type _Nodepool Nodepool // 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 NewNodepool(availabilityZones *[]string, machine *Machine, maximum *int64, minimum *int64, name *string, volume *Volume) *Nodepool { +func NewNodepool(availabilityZones NodepoolGetAvailabilityZonesArgType, machine NodepoolGetMachineArgType, maximum NodepoolGetMaximumArgType, minimum NodepoolGetMinimumArgType, name NodepoolGetNameArgType, volume NodepoolGetVolumeArgType) *Nodepool { this := Nodepool{} - this.AvailabilityZones = availabilityZones - this.Machine = machine - this.Maximum = maximum - this.Minimum = minimum - this.Name = name - this.Volume = volume + setNodepoolGetAvailabilityZonesAttributeType(&this.AvailabilityZones, availabilityZones) + setNodepoolGetMachineAttributeType(&this.Machine, machine) + setNodepoolGetMaximumAttributeType(&this.Maximum, maximum) + setNodepoolGetMinimumAttributeType(&this.Minimum, minimum) + setNodepoolGetNameAttributeType(&this.Name, name) + setNodepoolGetVolumeAttributeType(&this.Volume, volume) return &this } @@ -73,367 +314,283 @@ func NewNodepoolWithDefaults() *Nodepool { } // GetAllowSystemComponents returns the AllowSystemComponents field value if set, zero value otherwise. -func (o *Nodepool) GetAllowSystemComponents() *bool { - if o == nil || IsNil(o.AllowSystemComponents) { - var ret *bool - return ret - } - return o.AllowSystemComponents +func (o *Nodepool) GetAllowSystemComponents() (res NodepoolgetAllowSystemComponentsRetType) { + res, _ = o.GetAllowSystemComponentsOk() + return } // GetAllowSystemComponentsOk returns a tuple with the AllowSystemComponents field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Nodepool) GetAllowSystemComponentsOk() (*bool, bool) { - if o == nil || IsNil(o.AllowSystemComponents) { - return nil, false - } - return o.AllowSystemComponents, true +func (o *Nodepool) GetAllowSystemComponentsOk() (ret NodepoolgetAllowSystemComponentsRetType, ok bool) { + return getNodepoolgetAllowSystemComponentsAttributeTypeOk(o.AllowSystemComponents) } // HasAllowSystemComponents returns a boolean if a field has been set. func (o *Nodepool) HasAllowSystemComponents() bool { - if o != nil && !IsNil(o.AllowSystemComponents) { - return true - } - - return false + _, ok := o.GetAllowSystemComponentsOk() + return ok } // SetAllowSystemComponents gets a reference to the given bool and assigns it to the AllowSystemComponents field. -func (o *Nodepool) SetAllowSystemComponents(v *bool) { - o.AllowSystemComponents = v +func (o *Nodepool) SetAllowSystemComponents(v NodepoolgetAllowSystemComponentsRetType) { + setNodepoolgetAllowSystemComponentsAttributeType(&o.AllowSystemComponents, v) } // GetAvailabilityZones returns the AvailabilityZones field value -func (o *Nodepool) GetAvailabilityZones() *[]string { - if o == nil || IsNil(o.AvailabilityZones) { - var ret *[]string - return ret - } - - return o.AvailabilityZones +func (o *Nodepool) GetAvailabilityZones() (ret NodepoolGetAvailabilityZonesRetType) { + ret, _ = o.GetAvailabilityZonesOk() + return ret } // GetAvailabilityZonesOk returns a tuple with the AvailabilityZones field value // and a boolean to check if the value has been set. -func (o *Nodepool) GetAvailabilityZonesOk() (*[]string, bool) { - if o == nil { - return nil, false - } - return o.AvailabilityZones, true +func (o *Nodepool) GetAvailabilityZonesOk() (ret NodepoolGetAvailabilityZonesRetType, ok bool) { + return getNodepoolGetAvailabilityZonesAttributeTypeOk(o.AvailabilityZones) } // SetAvailabilityZones sets field value -func (o *Nodepool) SetAvailabilityZones(v *[]string) { - o.AvailabilityZones = v +func (o *Nodepool) SetAvailabilityZones(v NodepoolGetAvailabilityZonesRetType) { + setNodepoolGetAvailabilityZonesAttributeType(&o.AvailabilityZones, v) } // GetCri returns the Cri field value if set, zero value otherwise. -func (o *Nodepool) GetCri() *CRI { - if o == nil || IsNil(o.Cri) { - var ret *CRI - return ret - } - return o.Cri +func (o *Nodepool) GetCri() (res NodepoolGetCriRetType) { + res, _ = o.GetCriOk() + return } // GetCriOk returns a tuple with the Cri field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Nodepool) GetCriOk() (*CRI, bool) { - if o == nil || IsNil(o.Cri) { - return nil, false - } - return o.Cri, true +func (o *Nodepool) GetCriOk() (ret NodepoolGetCriRetType, ok bool) { + return getNodepoolGetCriAttributeTypeOk(o.Cri) } // HasCri returns a boolean if a field has been set. func (o *Nodepool) HasCri() bool { - if o != nil && !IsNil(o.Cri) { - return true - } - - return false + _, ok := o.GetCriOk() + return ok } // SetCri gets a reference to the given CRI and assigns it to the Cri field. -func (o *Nodepool) SetCri(v *CRI) { - o.Cri = v +func (o *Nodepool) SetCri(v NodepoolGetCriRetType) { + setNodepoolGetCriAttributeType(&o.Cri, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *Nodepool) GetLabels() *map[string]string { - if o == nil || IsNil(o.Labels) { - var ret *map[string]string - return ret - } - return o.Labels +func (o *Nodepool) GetLabels() (res NodepoolGetLabelsRetType) { + 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 *Nodepool) GetLabelsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Labels) { - return nil, false - } - return o.Labels, true +func (o *Nodepool) GetLabelsOk() (ret NodepoolGetLabelsRetType, ok bool) { + return getNodepoolGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *Nodepool) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false + _, ok := o.GetLabelsOk() + return ok } // SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *Nodepool) SetLabels(v *map[string]string) { - o.Labels = v +func (o *Nodepool) SetLabels(v NodepoolGetLabelsRetType) { + setNodepoolGetLabelsAttributeType(&o.Labels, v) } // GetMachine returns the Machine field value -func (o *Nodepool) GetMachine() *Machine { - if o == nil || IsNil(o.Machine) { - var ret *Machine - return ret - } - - return o.Machine +func (o *Nodepool) GetMachine() (ret NodepoolGetMachineRetType) { + ret, _ = o.GetMachineOk() + return ret } // GetMachineOk returns a tuple with the Machine field value // and a boolean to check if the value has been set. -func (o *Nodepool) GetMachineOk() (*Machine, bool) { - if o == nil { - return nil, false - } - return o.Machine, true +func (o *Nodepool) GetMachineOk() (ret NodepoolGetMachineRetType, ok bool) { + return getNodepoolGetMachineAttributeTypeOk(o.Machine) } // SetMachine sets field value -func (o *Nodepool) SetMachine(v *Machine) { - o.Machine = v +func (o *Nodepool) SetMachine(v NodepoolGetMachineRetType) { + setNodepoolGetMachineAttributeType(&o.Machine, v) } // GetMaxSurge returns the MaxSurge field value if set, zero value otherwise. -func (o *Nodepool) GetMaxSurge() *int64 { - if o == nil || IsNil(o.MaxSurge) { - var ret *int64 - return ret - } - return o.MaxSurge +func (o *Nodepool) GetMaxSurge() (res NodepoolGetMaxSurgeRetType) { + res, _ = o.GetMaxSurgeOk() + return } // GetMaxSurgeOk returns a tuple with the MaxSurge field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Nodepool) GetMaxSurgeOk() (*int64, bool) { - if o == nil || IsNil(o.MaxSurge) { - return nil, false - } - return o.MaxSurge, true +func (o *Nodepool) GetMaxSurgeOk() (ret NodepoolGetMaxSurgeRetType, ok bool) { + return getNodepoolGetMaxSurgeAttributeTypeOk(o.MaxSurge) } // HasMaxSurge returns a boolean if a field has been set. func (o *Nodepool) HasMaxSurge() bool { - if o != nil && !IsNil(o.MaxSurge) { - return true - } - - return false + _, ok := o.GetMaxSurgeOk() + return ok } // SetMaxSurge gets a reference to the given int64 and assigns it to the MaxSurge field. -func (o *Nodepool) SetMaxSurge(v *int64) { - o.MaxSurge = v +func (o *Nodepool) SetMaxSurge(v NodepoolGetMaxSurgeRetType) { + setNodepoolGetMaxSurgeAttributeType(&o.MaxSurge, v) } // GetMaxUnavailable returns the MaxUnavailable field value if set, zero value otherwise. -func (o *Nodepool) GetMaxUnavailable() *int64 { - if o == nil || IsNil(o.MaxUnavailable) { - var ret *int64 - return ret - } - return o.MaxUnavailable +func (o *Nodepool) GetMaxUnavailable() (res NodepoolGetMaxUnavailableRetType) { + res, _ = o.GetMaxUnavailableOk() + return } // GetMaxUnavailableOk returns a tuple with the MaxUnavailable field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Nodepool) GetMaxUnavailableOk() (*int64, bool) { - if o == nil || IsNil(o.MaxUnavailable) { - return nil, false - } - return o.MaxUnavailable, true +func (o *Nodepool) GetMaxUnavailableOk() (ret NodepoolGetMaxUnavailableRetType, ok bool) { + return getNodepoolGetMaxUnavailableAttributeTypeOk(o.MaxUnavailable) } // HasMaxUnavailable returns a boolean if a field has been set. func (o *Nodepool) HasMaxUnavailable() bool { - if o != nil && !IsNil(o.MaxUnavailable) { - return true - } - - return false + _, ok := o.GetMaxUnavailableOk() + return ok } // SetMaxUnavailable gets a reference to the given int64 and assigns it to the MaxUnavailable field. -func (o *Nodepool) SetMaxUnavailable(v *int64) { - o.MaxUnavailable = v +func (o *Nodepool) SetMaxUnavailable(v NodepoolGetMaxUnavailableRetType) { + setNodepoolGetMaxUnavailableAttributeType(&o.MaxUnavailable, v) } // GetMaximum returns the Maximum field value -func (o *Nodepool) GetMaximum() *int64 { - if o == nil || IsNil(o.Maximum) { - var ret *int64 - return ret - } - - return o.Maximum +func (o *Nodepool) GetMaximum() (ret NodepoolGetMaximumRetType) { + ret, _ = o.GetMaximumOk() + return ret } // GetMaximumOk returns a tuple with the Maximum field value // and a boolean to check if the value has been set. -func (o *Nodepool) GetMaximumOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Maximum, true +func (o *Nodepool) GetMaximumOk() (ret NodepoolGetMaximumRetType, ok bool) { + return getNodepoolGetMaximumAttributeTypeOk(o.Maximum) } // SetMaximum sets field value -func (o *Nodepool) SetMaximum(v *int64) { - o.Maximum = v +func (o *Nodepool) SetMaximum(v NodepoolGetMaximumRetType) { + setNodepoolGetMaximumAttributeType(&o.Maximum, v) } // GetMinimum returns the Minimum field value -func (o *Nodepool) GetMinimum() *int64 { - if o == nil || IsNil(o.Minimum) { - var ret *int64 - return ret - } - - return o.Minimum +func (o *Nodepool) GetMinimum() (ret NodepoolGetMinimumRetType) { + ret, _ = o.GetMinimumOk() + return ret } // GetMinimumOk returns a tuple with the Minimum field value // and a boolean to check if the value has been set. -func (o *Nodepool) GetMinimumOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Minimum, true +func (o *Nodepool) GetMinimumOk() (ret NodepoolGetMinimumRetType, ok bool) { + return getNodepoolGetMinimumAttributeTypeOk(o.Minimum) } // SetMinimum sets field value -func (o *Nodepool) SetMinimum(v *int64) { - o.Minimum = v +func (o *Nodepool) SetMinimum(v NodepoolGetMinimumRetType) { + setNodepoolGetMinimumAttributeType(&o.Minimum, v) } // GetName returns the Name field value -func (o *Nodepool) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *Nodepool) GetName() (ret NodepoolGetNameRetType) { + 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 *Nodepool) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *Nodepool) GetNameOk() (ret NodepoolGetNameRetType, ok bool) { + return getNodepoolGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *Nodepool) SetName(v *string) { - o.Name = v +func (o *Nodepool) SetName(v NodepoolGetNameRetType) { + setNodepoolGetNameAttributeType(&o.Name, v) } // GetTaints returns the Taints field value if set, zero value otherwise. -func (o *Nodepool) GetTaints() *[]Taint { - if o == nil || IsNil(o.Taints) { - var ret *[]Taint - return ret - } - return o.Taints +func (o *Nodepool) GetTaints() (res NodepoolGetTaintsRetType) { + res, _ = o.GetTaintsOk() + return } // GetTaintsOk returns a tuple with the Taints field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Nodepool) GetTaintsOk() (*[]Taint, bool) { - if o == nil || IsNil(o.Taints) { - return nil, false - } - return o.Taints, true +func (o *Nodepool) GetTaintsOk() (ret NodepoolGetTaintsRetType, ok bool) { + return getNodepoolGetTaintsAttributeTypeOk(o.Taints) } // HasTaints returns a boolean if a field has been set. func (o *Nodepool) HasTaints() bool { - if o != nil && !IsNil(o.Taints) { - return true - } - - return false + _, ok := o.GetTaintsOk() + return ok } // SetTaints gets a reference to the given []Taint and assigns it to the Taints field. -func (o *Nodepool) SetTaints(v *[]Taint) { - o.Taints = v +func (o *Nodepool) SetTaints(v NodepoolGetTaintsRetType) { + setNodepoolGetTaintsAttributeType(&o.Taints, v) } // GetVolume returns the Volume field value -func (o *Nodepool) GetVolume() *Volume { - if o == nil || IsNil(o.Volume) { - var ret *Volume - return ret - } - - return o.Volume +func (o *Nodepool) GetVolume() (ret NodepoolGetVolumeRetType) { + ret, _ = o.GetVolumeOk() + return ret } // GetVolumeOk returns a tuple with the Volume field value // and a boolean to check if the value has been set. -func (o *Nodepool) GetVolumeOk() (*Volume, bool) { - if o == nil { - return nil, false - } - return o.Volume, true +func (o *Nodepool) GetVolumeOk() (ret NodepoolGetVolumeRetType, ok bool) { + return getNodepoolGetVolumeAttributeTypeOk(o.Volume) } // SetVolume sets field value -func (o *Nodepool) SetVolume(v *Volume) { - o.Volume = v +func (o *Nodepool) SetVolume(v NodepoolGetVolumeRetType) { + setNodepoolGetVolumeAttributeType(&o.Volume, v) } func (o Nodepool) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.AllowSystemComponents) { - toSerialize["allowSystemComponents"] = o.AllowSystemComponents + if val, ok := getNodepoolgetAllowSystemComponentsAttributeTypeOk(o.AllowSystemComponents); ok { + toSerialize["AllowSystemComponents"] = val + } + if val, ok := getNodepoolGetAvailabilityZonesAttributeTypeOk(o.AvailabilityZones); ok { + toSerialize["AvailabilityZones"] = val + } + if val, ok := getNodepoolGetCriAttributeTypeOk(o.Cri); ok { + toSerialize["Cri"] = val + } + if val, ok := getNodepoolGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getNodepoolGetMachineAttributeTypeOk(o.Machine); ok { + toSerialize["Machine"] = val + } + if val, ok := getNodepoolGetMaxSurgeAttributeTypeOk(o.MaxSurge); ok { + toSerialize["MaxSurge"] = val + } + if val, ok := getNodepoolGetMaxUnavailableAttributeTypeOk(o.MaxUnavailable); ok { + toSerialize["MaxUnavailable"] = val } - toSerialize["availabilityZones"] = o.AvailabilityZones - if !IsNil(o.Cri) { - toSerialize["cri"] = o.Cri + if val, ok := getNodepoolGetMaximumAttributeTypeOk(o.Maximum); ok { + toSerialize["Maximum"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getNodepoolGetMinimumAttributeTypeOk(o.Minimum); ok { + toSerialize["Minimum"] = val } - toSerialize["machine"] = o.Machine - if !IsNil(o.MaxSurge) { - toSerialize["maxSurge"] = o.MaxSurge + if val, ok := getNodepoolGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.MaxUnavailable) { - toSerialize["maxUnavailable"] = o.MaxUnavailable + if val, ok := getNodepoolGetTaintsAttributeTypeOk(o.Taints); ok { + toSerialize["Taints"] = val } - toSerialize["maximum"] = o.Maximum - toSerialize["minimum"] = o.Minimum - toSerialize["name"] = o.Name - if !IsNil(o.Taints) { - toSerialize["taints"] = o.Taints + if val, ok := getNodepoolGetVolumeAttributeTypeOk(o.Volume); ok { + toSerialize["Volume"] = val } - toSerialize["volume"] = o.Volume return toSerialize, nil } diff --git a/services/ske/model_provider_options.go b/services/ske/model_provider_options.go index a68522dc1..a79f64dc7 100644 --- a/services/ske/model_provider_options.go +++ b/services/ske/model_provider_options.go @@ -17,13 +17,113 @@ import ( // checks if the ProviderOptions type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ProviderOptions{} +/* + types and functions for availabilityZones +*/ + +// isArray +type ProviderOptionsGetAvailabilityZonesAttributeType = *[]AvailabilityZone +type ProviderOptionsGetAvailabilityZonesArgType = []AvailabilityZone +type ProviderOptionsGetAvailabilityZonesRetType = []AvailabilityZone + +func getProviderOptionsGetAvailabilityZonesAttributeTypeOk(arg ProviderOptionsGetAvailabilityZonesAttributeType) (ret ProviderOptionsGetAvailabilityZonesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setProviderOptionsGetAvailabilityZonesAttributeType(arg *ProviderOptionsGetAvailabilityZonesAttributeType, val ProviderOptionsGetAvailabilityZonesRetType) { + *arg = &val +} + +/* + types and functions for kubernetesVersions +*/ + +// isArray +type ProviderOptionsGetKubernetesVersionsAttributeType = *[]KubernetesVersion +type ProviderOptionsGetKubernetesVersionsArgType = []KubernetesVersion +type ProviderOptionsGetKubernetesVersionsRetType = []KubernetesVersion + +func getProviderOptionsGetKubernetesVersionsAttributeTypeOk(arg ProviderOptionsGetKubernetesVersionsAttributeType) (ret ProviderOptionsGetKubernetesVersionsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setProviderOptionsGetKubernetesVersionsAttributeType(arg *ProviderOptionsGetKubernetesVersionsAttributeType, val ProviderOptionsGetKubernetesVersionsRetType) { + *arg = &val +} + +/* + types and functions for machineImages +*/ + +// isArray +type ProviderOptionsGetMachineImagesAttributeType = *[]MachineImage +type ProviderOptionsGetMachineImagesArgType = []MachineImage +type ProviderOptionsGetMachineImagesRetType = []MachineImage + +func getProviderOptionsGetMachineImagesAttributeTypeOk(arg ProviderOptionsGetMachineImagesAttributeType) (ret ProviderOptionsGetMachineImagesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setProviderOptionsGetMachineImagesAttributeType(arg *ProviderOptionsGetMachineImagesAttributeType, val ProviderOptionsGetMachineImagesRetType) { + *arg = &val +} + +/* + types and functions for machineTypes +*/ + +// isArray +type ProviderOptionsGetMachineTypesAttributeType = *[]MachineType +type ProviderOptionsGetMachineTypesArgType = []MachineType +type ProviderOptionsGetMachineTypesRetType = []MachineType + +func getProviderOptionsGetMachineTypesAttributeTypeOk(arg ProviderOptionsGetMachineTypesAttributeType) (ret ProviderOptionsGetMachineTypesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setProviderOptionsGetMachineTypesAttributeType(arg *ProviderOptionsGetMachineTypesAttributeType, val ProviderOptionsGetMachineTypesRetType) { + *arg = &val +} + +/* + types and functions for volumeTypes +*/ + +// isArray +type ProviderOptionsGetVolumeTypesAttributeType = *[]VolumeType +type ProviderOptionsGetVolumeTypesArgType = []VolumeType +type ProviderOptionsGetVolumeTypesRetType = []VolumeType + +func getProviderOptionsGetVolumeTypesAttributeTypeOk(arg ProviderOptionsGetVolumeTypesAttributeType) (ret ProviderOptionsGetVolumeTypesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setProviderOptionsGetVolumeTypesAttributeType(arg *ProviderOptionsGetVolumeTypesAttributeType, val ProviderOptionsGetVolumeTypesRetType) { + *arg = &val +} + // ProviderOptions struct for ProviderOptions type ProviderOptions struct { - AvailabilityZones *[]AvailabilityZone `json:"availabilityZones,omitempty"` - KubernetesVersions *[]KubernetesVersion `json:"kubernetesVersions,omitempty"` - MachineImages *[]MachineImage `json:"machineImages,omitempty"` - MachineTypes *[]MachineType `json:"machineTypes,omitempty"` - VolumeTypes *[]VolumeType `json:"volumeTypes,omitempty"` + AvailabilityZones ProviderOptionsGetAvailabilityZonesAttributeType `json:"availabilityZones,omitempty"` + KubernetesVersions ProviderOptionsGetKubernetesVersionsAttributeType `json:"kubernetesVersions,omitempty"` + MachineImages ProviderOptionsGetMachineImagesAttributeType `json:"machineImages,omitempty"` + MachineTypes ProviderOptionsGetMachineTypesAttributeType `json:"machineTypes,omitempty"` + VolumeTypes ProviderOptionsGetVolumeTypesAttributeType `json:"volumeTypes,omitempty"` } // NewProviderOptions instantiates a new ProviderOptions object @@ -44,181 +144,136 @@ func NewProviderOptionsWithDefaults() *ProviderOptions { } // GetAvailabilityZones returns the AvailabilityZones field value if set, zero value otherwise. -func (o *ProviderOptions) GetAvailabilityZones() *[]AvailabilityZone { - if o == nil || IsNil(o.AvailabilityZones) { - var ret *[]AvailabilityZone - return ret - } - return o.AvailabilityZones +func (o *ProviderOptions) GetAvailabilityZones() (res ProviderOptionsGetAvailabilityZonesRetType) { + res, _ = o.GetAvailabilityZonesOk() + return } // GetAvailabilityZonesOk returns a tuple with the AvailabilityZones field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ProviderOptions) GetAvailabilityZonesOk() (*[]AvailabilityZone, bool) { - if o == nil || IsNil(o.AvailabilityZones) { - return nil, false - } - return o.AvailabilityZones, true +func (o *ProviderOptions) GetAvailabilityZonesOk() (ret ProviderOptionsGetAvailabilityZonesRetType, ok bool) { + return getProviderOptionsGetAvailabilityZonesAttributeTypeOk(o.AvailabilityZones) } // HasAvailabilityZones returns a boolean if a field has been set. func (o *ProviderOptions) HasAvailabilityZones() bool { - if o != nil && !IsNil(o.AvailabilityZones) { - return true - } - - return false + _, ok := o.GetAvailabilityZonesOk() + return ok } // SetAvailabilityZones gets a reference to the given []AvailabilityZone and assigns it to the AvailabilityZones field. -func (o *ProviderOptions) SetAvailabilityZones(v *[]AvailabilityZone) { - o.AvailabilityZones = v +func (o *ProviderOptions) SetAvailabilityZones(v ProviderOptionsGetAvailabilityZonesRetType) { + setProviderOptionsGetAvailabilityZonesAttributeType(&o.AvailabilityZones, v) } // GetKubernetesVersions returns the KubernetesVersions field value if set, zero value otherwise. -func (o *ProviderOptions) GetKubernetesVersions() *[]KubernetesVersion { - if o == nil || IsNil(o.KubernetesVersions) { - var ret *[]KubernetesVersion - return ret - } - return o.KubernetesVersions +func (o *ProviderOptions) GetKubernetesVersions() (res ProviderOptionsGetKubernetesVersionsRetType) { + res, _ = o.GetKubernetesVersionsOk() + return } // GetKubernetesVersionsOk returns a tuple with the KubernetesVersions field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ProviderOptions) GetKubernetesVersionsOk() (*[]KubernetesVersion, bool) { - if o == nil || IsNil(o.KubernetesVersions) { - return nil, false - } - return o.KubernetesVersions, true +func (o *ProviderOptions) GetKubernetesVersionsOk() (ret ProviderOptionsGetKubernetesVersionsRetType, ok bool) { + return getProviderOptionsGetKubernetesVersionsAttributeTypeOk(o.KubernetesVersions) } // HasKubernetesVersions returns a boolean if a field has been set. func (o *ProviderOptions) HasKubernetesVersions() bool { - if o != nil && !IsNil(o.KubernetesVersions) { - return true - } - - return false + _, ok := o.GetKubernetesVersionsOk() + return ok } // SetKubernetesVersions gets a reference to the given []KubernetesVersion and assigns it to the KubernetesVersions field. -func (o *ProviderOptions) SetKubernetesVersions(v *[]KubernetesVersion) { - o.KubernetesVersions = v +func (o *ProviderOptions) SetKubernetesVersions(v ProviderOptionsGetKubernetesVersionsRetType) { + setProviderOptionsGetKubernetesVersionsAttributeType(&o.KubernetesVersions, v) } // GetMachineImages returns the MachineImages field value if set, zero value otherwise. -func (o *ProviderOptions) GetMachineImages() *[]MachineImage { - if o == nil || IsNil(o.MachineImages) { - var ret *[]MachineImage - return ret - } - return o.MachineImages +func (o *ProviderOptions) GetMachineImages() (res ProviderOptionsGetMachineImagesRetType) { + res, _ = o.GetMachineImagesOk() + return } // GetMachineImagesOk returns a tuple with the MachineImages field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ProviderOptions) GetMachineImagesOk() (*[]MachineImage, bool) { - if o == nil || IsNil(o.MachineImages) { - return nil, false - } - return o.MachineImages, true +func (o *ProviderOptions) GetMachineImagesOk() (ret ProviderOptionsGetMachineImagesRetType, ok bool) { + return getProviderOptionsGetMachineImagesAttributeTypeOk(o.MachineImages) } // HasMachineImages returns a boolean if a field has been set. func (o *ProviderOptions) HasMachineImages() bool { - if o != nil && !IsNil(o.MachineImages) { - return true - } - - return false + _, ok := o.GetMachineImagesOk() + return ok } // SetMachineImages gets a reference to the given []MachineImage and assigns it to the MachineImages field. -func (o *ProviderOptions) SetMachineImages(v *[]MachineImage) { - o.MachineImages = v +func (o *ProviderOptions) SetMachineImages(v ProviderOptionsGetMachineImagesRetType) { + setProviderOptionsGetMachineImagesAttributeType(&o.MachineImages, v) } // GetMachineTypes returns the MachineTypes field value if set, zero value otherwise. -func (o *ProviderOptions) GetMachineTypes() *[]MachineType { - if o == nil || IsNil(o.MachineTypes) { - var ret *[]MachineType - return ret - } - return o.MachineTypes +func (o *ProviderOptions) GetMachineTypes() (res ProviderOptionsGetMachineTypesRetType) { + res, _ = o.GetMachineTypesOk() + return } // GetMachineTypesOk returns a tuple with the MachineTypes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ProviderOptions) GetMachineTypesOk() (*[]MachineType, bool) { - if o == nil || IsNil(o.MachineTypes) { - return nil, false - } - return o.MachineTypes, true +func (o *ProviderOptions) GetMachineTypesOk() (ret ProviderOptionsGetMachineTypesRetType, ok bool) { + return getProviderOptionsGetMachineTypesAttributeTypeOk(o.MachineTypes) } // HasMachineTypes returns a boolean if a field has been set. func (o *ProviderOptions) HasMachineTypes() bool { - if o != nil && !IsNil(o.MachineTypes) { - return true - } - - return false + _, ok := o.GetMachineTypesOk() + return ok } // SetMachineTypes gets a reference to the given []MachineType and assigns it to the MachineTypes field. -func (o *ProviderOptions) SetMachineTypes(v *[]MachineType) { - o.MachineTypes = v +func (o *ProviderOptions) SetMachineTypes(v ProviderOptionsGetMachineTypesRetType) { + setProviderOptionsGetMachineTypesAttributeType(&o.MachineTypes, v) } // GetVolumeTypes returns the VolumeTypes field value if set, zero value otherwise. -func (o *ProviderOptions) GetVolumeTypes() *[]VolumeType { - if o == nil || IsNil(o.VolumeTypes) { - var ret *[]VolumeType - return ret - } - return o.VolumeTypes +func (o *ProviderOptions) GetVolumeTypes() (res ProviderOptionsGetVolumeTypesRetType) { + res, _ = o.GetVolumeTypesOk() + return } // GetVolumeTypesOk returns a tuple with the VolumeTypes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ProviderOptions) GetVolumeTypesOk() (*[]VolumeType, bool) { - if o == nil || IsNil(o.VolumeTypes) { - return nil, false - } - return o.VolumeTypes, true +func (o *ProviderOptions) GetVolumeTypesOk() (ret ProviderOptionsGetVolumeTypesRetType, ok bool) { + return getProviderOptionsGetVolumeTypesAttributeTypeOk(o.VolumeTypes) } // HasVolumeTypes returns a boolean if a field has been set. func (o *ProviderOptions) HasVolumeTypes() bool { - if o != nil && !IsNil(o.VolumeTypes) { - return true - } - - return false + _, ok := o.GetVolumeTypesOk() + return ok } // SetVolumeTypes gets a reference to the given []VolumeType and assigns it to the VolumeTypes field. -func (o *ProviderOptions) SetVolumeTypes(v *[]VolumeType) { - o.VolumeTypes = v +func (o *ProviderOptions) SetVolumeTypes(v ProviderOptionsGetVolumeTypesRetType) { + setProviderOptionsGetVolumeTypesAttributeType(&o.VolumeTypes, v) } func (o ProviderOptions) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.AvailabilityZones) { - toSerialize["availabilityZones"] = o.AvailabilityZones + if val, ok := getProviderOptionsGetAvailabilityZonesAttributeTypeOk(o.AvailabilityZones); ok { + toSerialize["AvailabilityZones"] = val } - if !IsNil(o.KubernetesVersions) { - toSerialize["kubernetesVersions"] = o.KubernetesVersions + if val, ok := getProviderOptionsGetKubernetesVersionsAttributeTypeOk(o.KubernetesVersions); ok { + toSerialize["KubernetesVersions"] = val } - if !IsNil(o.MachineImages) { - toSerialize["machineImages"] = o.MachineImages + if val, ok := getProviderOptionsGetMachineImagesAttributeTypeOk(o.MachineImages); ok { + toSerialize["MachineImages"] = val } - if !IsNil(o.MachineTypes) { - toSerialize["machineTypes"] = o.MachineTypes + if val, ok := getProviderOptionsGetMachineTypesAttributeTypeOk(o.MachineTypes); ok { + toSerialize["MachineTypes"] = val } - if !IsNil(o.VolumeTypes) { - toSerialize["volumeTypes"] = o.VolumeTypes + if val, ok := getProviderOptionsGetVolumeTypesAttributeTypeOk(o.VolumeTypes); ok { + toSerialize["VolumeTypes"] = val } return toSerialize, nil } diff --git a/services/ske/model_runtime_error.go b/services/ske/model_runtime_error.go index 4c63a7e71..f3939086f 100644 --- a/services/ske/model_runtime_error.go +++ b/services/ske/model_runtime_error.go @@ -17,12 +17,74 @@ import ( // checks if the RuntimeError type satisfies the MappedNullable interface at compile time var _ MappedNullable = &RuntimeError{} +/* + types and functions for code +*/ + +// isEnumRef +type RuntimeErrorGetCodeAttributeType = *string +type RuntimeErrorGetCodeArgType = string +type RuntimeErrorGetCodeRetType = string + +func getRuntimeErrorGetCodeAttributeTypeOk(arg RuntimeErrorGetCodeAttributeType) (ret RuntimeErrorGetCodeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRuntimeErrorGetCodeAttributeType(arg *RuntimeErrorGetCodeAttributeType, val RuntimeErrorGetCodeRetType) { + *arg = &val +} + +/* + types and functions for details +*/ + +// isNotNullableString +type RuntimeErrorGetDetailsAttributeType = *string + +func getRuntimeErrorGetDetailsAttributeTypeOk(arg RuntimeErrorGetDetailsAttributeType) (ret RuntimeErrorGetDetailsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRuntimeErrorGetDetailsAttributeType(arg *RuntimeErrorGetDetailsAttributeType, val RuntimeErrorGetDetailsRetType) { + *arg = &val +} + +type RuntimeErrorGetDetailsArgType = string +type RuntimeErrorGetDetailsRetType = string + +/* + types and functions for message +*/ + +// isNotNullableString +type RuntimeErrorGetMessageAttributeType = *string + +func getRuntimeErrorGetMessageAttributeTypeOk(arg RuntimeErrorGetMessageAttributeType) (ret RuntimeErrorGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setRuntimeErrorGetMessageAttributeType(arg *RuntimeErrorGetMessageAttributeType, val RuntimeErrorGetMessageRetType) { + *arg = &val +} + +type RuntimeErrorGetMessageArgType = string +type RuntimeErrorGetMessageRetType = string + // RuntimeError struct for RuntimeError type RuntimeError struct { // - Code: `SKE_UNSPECIFIED` Message: \"An error occurred. Please open a support ticket if this error persists.\" - Code: `SKE_TMP_AUTH_ERROR` Message: \"Authentication failed. This is a temporary error. Please wait while the system recovers.\" - Code: `SKE_QUOTA_EXCEEDED` Message: \"Your project's resource quotas are exhausted. Please make sure your quota is sufficient for the ordered cluster.\" - Code: `SKE_ARGUS_INSTANCE_NOT_FOUND` Message: \"The provided Argus instance could not be found.\" - Code: `SKE_RATE_LIMITS` Message: \"While provisioning your cluster, request rate limits where incurred. Please wait while the system recovers.\" - Code: `SKE_INFRA_ERROR` Message: \"An error occurred with the underlying infrastructure. Please open a support ticket if this error persists.\" - Code: `SKE_REMAINING_RESOURCES` Message: \"There are remaining Kubernetes resources in your cluster that prevent deletion. Please make sure to remove them.\" - Code: `SKE_CONFIGURATION_PROBLEM` Message: \"A configuration error occurred. Please open a support ticket if this error persists.\" - Code: `SKE_UNREADY_NODES` Message: \"Not all worker nodes are ready. Please open a support ticket if this error persists.\" - Code: `SKE_API_SERVER_ERROR` Message: \"The Kubernetes API server is not reporting readiness. Please open a support ticket if this error persists.\" - Code: `SKE_DNS_ZONE_NOT_FOUND` Message: \"The provided DNS zone for the STACKIT DNS extension could not be found. Please ensure you defined a valid domain that belongs to a STACKIT DNS zone.\" - Code *string `json:"code,omitempty"` - Details *string `json:"details,omitempty"` - Message *string `json:"message,omitempty"` + Code RuntimeErrorGetCodeAttributeType `json:"code,omitempty"` + Details RuntimeErrorGetDetailsAttributeType `json:"details,omitempty"` + Message RuntimeErrorGetMessageAttributeType `json:"message,omitempty"` } // NewRuntimeError instantiates a new RuntimeError object @@ -43,111 +105,84 @@ func NewRuntimeErrorWithDefaults() *RuntimeError { } // GetCode returns the Code field value if set, zero value otherwise. -func (o *RuntimeError) GetCode() *string { - if o == nil || IsNil(o.Code) { - var ret *string - return ret - } - return o.Code +func (o *RuntimeError) GetCode() (res RuntimeErrorGetCodeRetType) { + res, _ = o.GetCodeOk() + return } // GetCodeOk returns a tuple with the Code field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RuntimeError) GetCodeOk() (*string, bool) { - if o == nil || IsNil(o.Code) { - return nil, false - } - return o.Code, true +func (o *RuntimeError) GetCodeOk() (ret RuntimeErrorGetCodeRetType, ok bool) { + return getRuntimeErrorGetCodeAttributeTypeOk(o.Code) } // HasCode returns a boolean if a field has been set. func (o *RuntimeError) HasCode() bool { - if o != nil && !IsNil(o.Code) { - return true - } - - return false + _, ok := o.GetCodeOk() + return ok } // SetCode gets a reference to the given string and assigns it to the Code field. -func (o *RuntimeError) SetCode(v *string) { - o.Code = v +func (o *RuntimeError) SetCode(v RuntimeErrorGetCodeRetType) { + setRuntimeErrorGetCodeAttributeType(&o.Code, v) } // GetDetails returns the Details field value if set, zero value otherwise. -func (o *RuntimeError) GetDetails() *string { - if o == nil || IsNil(o.Details) { - var ret *string - return ret - } - return o.Details +func (o *RuntimeError) GetDetails() (res RuntimeErrorGetDetailsRetType) { + 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 *RuntimeError) GetDetailsOk() (*string, bool) { - if o == nil || IsNil(o.Details) { - return nil, false - } - return o.Details, true +func (o *RuntimeError) GetDetailsOk() (ret RuntimeErrorGetDetailsRetType, ok bool) { + return getRuntimeErrorGetDetailsAttributeTypeOk(o.Details) } // HasDetails returns a boolean if a field has been set. func (o *RuntimeError) 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 *RuntimeError) SetDetails(v *string) { - o.Details = v +func (o *RuntimeError) SetDetails(v RuntimeErrorGetDetailsRetType) { + setRuntimeErrorGetDetailsAttributeType(&o.Details, v) } // GetMessage returns the Message field value if set, zero value otherwise. -func (o *RuntimeError) GetMessage() *string { - if o == nil || IsNil(o.Message) { - var ret *string - return ret - } - return o.Message +func (o *RuntimeError) GetMessage() (res RuntimeErrorGetMessageRetType) { + res, _ = o.GetMessageOk() + return } // GetMessageOk returns a tuple with the Message field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RuntimeError) GetMessageOk() (*string, bool) { - if o == nil || IsNil(o.Message) { - return nil, false - } - return o.Message, true +func (o *RuntimeError) GetMessageOk() (ret RuntimeErrorGetMessageRetType, ok bool) { + return getRuntimeErrorGetMessageAttributeTypeOk(o.Message) } // HasMessage returns a boolean if a field has been set. func (o *RuntimeError) HasMessage() bool { - if o != nil && !IsNil(o.Message) { - return true - } - - return false + _, ok := o.GetMessageOk() + return ok } // SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *RuntimeError) SetMessage(v *string) { - o.Message = v +func (o *RuntimeError) SetMessage(v RuntimeErrorGetMessageRetType) { + setRuntimeErrorGetMessageAttributeType(&o.Message, v) } func (o RuntimeError) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Code) { - toSerialize["code"] = o.Code + if val, ok := getRuntimeErrorGetCodeAttributeTypeOk(o.Code); ok { + toSerialize["Code"] = val } - if !IsNil(o.Details) { - toSerialize["details"] = o.Details + if val, ok := getRuntimeErrorGetDetailsAttributeTypeOk(o.Details); ok { + toSerialize["Details"] = val } - if !IsNil(o.Message) { - toSerialize["message"] = o.Message + if val, ok := getRuntimeErrorGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val } return toSerialize, nil } diff --git a/services/ske/model_taint.go b/services/ske/model_taint.go index 1357f0430..40ee56884 100644 --- a/services/ske/model_taint.go +++ b/services/ske/model_taint.go @@ -17,13 +17,75 @@ import ( // checks if the Taint type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Taint{} +/* + types and functions for effect +*/ + +// isEnumRef +type TaintGetEffectAttributeType = *string +type TaintGetEffectArgType = string +type TaintGetEffectRetType = string + +func getTaintGetEffectAttributeTypeOk(arg TaintGetEffectAttributeType) (ret TaintGetEffectRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setTaintGetEffectAttributeType(arg *TaintGetEffectAttributeType, val TaintGetEffectRetType) { + *arg = &val +} + +/* + types and functions for key +*/ + +// isNotNullableString +type TaintGetKeyAttributeType = *string + +func getTaintGetKeyAttributeTypeOk(arg TaintGetKeyAttributeType) (ret TaintGetKeyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setTaintGetKeyAttributeType(arg *TaintGetKeyAttributeType, val TaintGetKeyRetType) { + *arg = &val +} + +type TaintGetKeyArgType = string +type TaintGetKeyRetType = string + +/* + types and functions for value +*/ + +// isNotNullableString +type TaintGetValueAttributeType = *string + +func getTaintGetValueAttributeTypeOk(arg TaintGetValueAttributeType) (ret TaintGetValueRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setTaintGetValueAttributeType(arg *TaintGetValueAttributeType, val TaintGetValueRetType) { + *arg = &val +} + +type TaintGetValueArgType = string +type TaintGetValueRetType = string + // Taint struct for Taint type Taint struct { // REQUIRED - Effect *string `json:"effect"` + Effect TaintGetEffectAttributeType `json:"effect"` // REQUIRED - Key *string `json:"key"` - Value *string `json:"value,omitempty"` + Key TaintGetKeyAttributeType `json:"key"` + Value TaintGetValueAttributeType `json:"value,omitempty"` } type _Taint Taint @@ -32,10 +94,10 @@ type _Taint Taint // 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 NewTaint(effect *string, key *string) *Taint { +func NewTaint(effect TaintGetEffectArgType, key TaintGetKeyArgType) *Taint { this := Taint{} - this.Effect = effect - this.Key = key + setTaintGetEffectAttributeType(&this.Effect, effect) + setTaintGetKeyAttributeType(&this.Key, key) return &this } @@ -48,91 +110,72 @@ func NewTaintWithDefaults() *Taint { } // GetEffect returns the Effect field value -func (o *Taint) GetEffect() *string { - if o == nil || IsNil(o.Effect) { - var ret *string - return ret - } - - return o.Effect +func (o *Taint) GetEffect() (ret TaintGetEffectRetType) { + ret, _ = o.GetEffectOk() + return ret } // GetEffectOk returns a tuple with the Effect field value // and a boolean to check if the value has been set. -func (o *Taint) GetEffectOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Effect, true +func (o *Taint) GetEffectOk() (ret TaintGetEffectRetType, ok bool) { + return getTaintGetEffectAttributeTypeOk(o.Effect) } // SetEffect sets field value -func (o *Taint) SetEffect(v *string) { - o.Effect = v +func (o *Taint) SetEffect(v TaintGetEffectRetType) { + setTaintGetEffectAttributeType(&o.Effect, v) } // GetKey returns the Key field value -func (o *Taint) GetKey() *string { - if o == nil || IsNil(o.Key) { - var ret *string - return ret - } - - return o.Key +func (o *Taint) GetKey() (ret TaintGetKeyRetType) { + ret, _ = o.GetKeyOk() + return ret } // GetKeyOk returns a tuple with the Key field value // and a boolean to check if the value has been set. -func (o *Taint) GetKeyOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Key, true +func (o *Taint) GetKeyOk() (ret TaintGetKeyRetType, ok bool) { + return getTaintGetKeyAttributeTypeOk(o.Key) } // SetKey sets field value -func (o *Taint) SetKey(v *string) { - o.Key = v +func (o *Taint) SetKey(v TaintGetKeyRetType) { + setTaintGetKeyAttributeType(&o.Key, v) } // GetValue returns the Value field value if set, zero value otherwise. -func (o *Taint) GetValue() *string { - if o == nil || IsNil(o.Value) { - var ret *string - return ret - } - return o.Value +func (o *Taint) GetValue() (res TaintGetValueRetType) { + res, _ = o.GetValueOk() + return } // GetValueOk returns a tuple with the Value field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Taint) GetValueOk() (*string, bool) { - if o == nil || IsNil(o.Value) { - return nil, false - } - return o.Value, true +func (o *Taint) GetValueOk() (ret TaintGetValueRetType, ok bool) { + return getTaintGetValueAttributeTypeOk(o.Value) } // HasValue returns a boolean if a field has been set. func (o *Taint) HasValue() bool { - if o != nil && !IsNil(o.Value) { - return true - } - - return false + _, ok := o.GetValueOk() + return ok } // SetValue gets a reference to the given string and assigns it to the Value field. -func (o *Taint) SetValue(v *string) { - o.Value = v +func (o *Taint) SetValue(v TaintGetValueRetType) { + setTaintGetValueAttributeType(&o.Value, v) } func (o Taint) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["effect"] = o.Effect - toSerialize["key"] = o.Key - if !IsNil(o.Value) { - toSerialize["value"] = o.Value + if val, ok := getTaintGetEffectAttributeTypeOk(o.Effect); ok { + toSerialize["Effect"] = val + } + if val, ok := getTaintGetKeyAttributeTypeOk(o.Key); ok { + toSerialize["Key"] = val + } + if val, ok := getTaintGetValueAttributeTypeOk(o.Value); ok { + toSerialize["Value"] = val } return toSerialize, nil } diff --git a/services/ske/model_time_window.go b/services/ske/model_time_window.go index cd9369023..89b693faa 100644 --- a/services/ske/model_time_window.go +++ b/services/ske/model_time_window.go @@ -18,12 +18,52 @@ import ( // checks if the TimeWindow type satisfies the MappedNullable interface at compile time var _ MappedNullable = &TimeWindow{} +/* + types and functions for end +*/ + +// isDateTime +type TimeWindowGetEndAttributeType = *time.Time +type TimeWindowGetEndArgType = time.Time +type TimeWindowGetEndRetType = time.Time + +func getTimeWindowGetEndAttributeTypeOk(arg TimeWindowGetEndAttributeType) (ret TimeWindowGetEndRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setTimeWindowGetEndAttributeType(arg *TimeWindowGetEndAttributeType, val TimeWindowGetEndRetType) { + *arg = &val +} + +/* + types and functions for start +*/ + +// isDateTime +type TimeWindowGetStartAttributeType = *time.Time +type TimeWindowGetStartArgType = time.Time +type TimeWindowGetStartRetType = time.Time + +func getTimeWindowGetStartAttributeTypeOk(arg TimeWindowGetStartAttributeType) (ret TimeWindowGetStartRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setTimeWindowGetStartAttributeType(arg *TimeWindowGetStartAttributeType, val TimeWindowGetStartRetType) { + *arg = &val +} + // TimeWindow struct for TimeWindow type TimeWindow struct { // REQUIRED - End *time.Time `json:"end"` + End TimeWindowGetEndAttributeType `json:"end"` // REQUIRED - Start *time.Time `json:"start"` + Start TimeWindowGetStartAttributeType `json:"start"` } type _TimeWindow TimeWindow @@ -32,10 +72,10 @@ type _TimeWindow TimeWindow // 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 NewTimeWindow(end *time.Time, start *time.Time) *TimeWindow { +func NewTimeWindow(end TimeWindowGetEndArgType, start TimeWindowGetStartArgType) *TimeWindow { this := TimeWindow{} - this.End = end - this.Start = start + setTimeWindowGetEndAttributeType(&this.End, end) + setTimeWindowGetStartAttributeType(&this.Start, start) return &this } @@ -48,57 +88,47 @@ func NewTimeWindowWithDefaults() *TimeWindow { } // GetEnd returns the End field value -func (o *TimeWindow) GetEnd() *time.Time { - if o == nil || IsNil(o.End) { - var ret *time.Time - return ret - } - - return o.End +func (o *TimeWindow) GetEnd() (ret TimeWindowGetEndRetType) { + ret, _ = o.GetEndOk() + return ret } // GetEndOk returns a tuple with the End field value // and a boolean to check if the value has been set. -func (o *TimeWindow) GetEndOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.End, true +func (o *TimeWindow) GetEndOk() (ret TimeWindowGetEndRetType, ok bool) { + return getTimeWindowGetEndAttributeTypeOk(o.End) } // SetEnd sets field value -func (o *TimeWindow) SetEnd(v *time.Time) { - o.End = v +func (o *TimeWindow) SetEnd(v TimeWindowGetEndRetType) { + setTimeWindowGetEndAttributeType(&o.End, v) } // GetStart returns the Start field value -func (o *TimeWindow) GetStart() *time.Time { - if o == nil || IsNil(o.Start) { - var ret *time.Time - return ret - } - - return o.Start +func (o *TimeWindow) GetStart() (ret TimeWindowGetStartRetType) { + ret, _ = o.GetStartOk() + return ret } // GetStartOk returns a tuple with the Start field value // and a boolean to check if the value has been set. -func (o *TimeWindow) GetStartOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.Start, true +func (o *TimeWindow) GetStartOk() (ret TimeWindowGetStartRetType, ok bool) { + return getTimeWindowGetStartAttributeTypeOk(o.Start) } // SetStart sets field value -func (o *TimeWindow) SetStart(v *time.Time) { - o.Start = v +func (o *TimeWindow) SetStart(v TimeWindowGetStartRetType) { + setTimeWindowGetStartAttributeType(&o.Start, v) } func (o TimeWindow) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["end"] = o.End - toSerialize["start"] = o.Start + if val, ok := getTimeWindowGetEndAttributeTypeOk(o.End); ok { + toSerialize["End"] = val + } + if val, ok := getTimeWindowGetStartAttributeTypeOk(o.Start); ok { + toSerialize["Start"] = val + } return toSerialize, nil } diff --git a/services/ske/model_volume.go b/services/ske/model_volume.go index 1d610d266..5b5e9e6a5 100644 --- a/services/ske/model_volume.go +++ b/services/ske/model_volume.go @@ -17,13 +17,54 @@ import ( // checks if the Volume type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Volume{} +/* + types and functions for size +*/ + +// isInteger +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 type +*/ + +// isNotNullableString +type VolumeGetTypeAttributeType = *string + +func getVolumeGetTypeAttributeTypeOk(arg VolumeGetTypeAttributeType) (ret VolumeGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeGetTypeAttributeType(arg *VolumeGetTypeAttributeType, val VolumeGetTypeRetType) { + *arg = &val +} + +type VolumeGetTypeArgType = string +type VolumeGetTypeRetType = string + // Volume struct for Volume type Volume struct { // Can be cast to int32 without loss of precision. // REQUIRED - Size *int64 `json:"size"` + Size VolumeGetSizeAttributeType `json:"size"` // For valid values please take a look at [provider-options](#tag/ProviderOptions/operation/SkeService_GetProviderOptions) `volumeTypes`. - Type *string `json:"type,omitempty"` + Type VolumeGetTypeAttributeType `json:"type,omitempty"` } type _Volume Volume @@ -32,9 +73,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(size *int64) *Volume { +func NewVolume(size VolumeGetSizeArgType) *Volume { this := Volume{} - this.Size = size + setVolumeGetSizeAttributeType(&this.Size, size) return &this } @@ -47,66 +88,52 @@ func NewVolumeWithDefaults() *Volume { } // GetSize returns the Size field value -func (o *Volume) GetSize() *int64 { - if o == nil || IsNil(o.Size) { - var ret *int64 - return ret - } - - return o.Size +func (o *Volume) GetSize() (ret VolumeGetSizeRetType) { + 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 *Volume) GetSizeOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.Size, true +func (o *Volume) GetSizeOk() (ret VolumeGetSizeRetType, ok bool) { + return getVolumeGetSizeAttributeTypeOk(o.Size) } // SetSize sets field value -func (o *Volume) SetSize(v *int64) { - o.Size = v +func (o *Volume) SetSize(v VolumeGetSizeRetType) { + setVolumeGetSizeAttributeType(&o.Size, v) } // GetType returns the Type field value if set, zero value otherwise. -func (o *Volume) GetType() *string { - if o == nil || IsNil(o.Type) { - var ret *string - return ret - } - return o.Type +func (o *Volume) GetType() (res VolumeGetTypeRetType) { + 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 *Volume) GetTypeOk() (*string, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return o.Type, true +func (o *Volume) GetTypeOk() (ret VolumeGetTypeRetType, ok bool) { + return getVolumeGetTypeAttributeTypeOk(o.Type) } // HasType returns a boolean if a field has been set. func (o *Volume) 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 *Volume) SetType(v *string) { - o.Type = v +func (o *Volume) SetType(v VolumeGetTypeRetType) { + setVolumeGetTypeAttributeType(&o.Type, v) } func (o Volume) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["size"] = o.Size - if !IsNil(o.Type) { - toSerialize["type"] = o.Type + if val, ok := getVolumeGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val + } + if val, ok := getVolumeGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val } return toSerialize, nil } diff --git a/services/ske/model_volume_type.go b/services/ske/model_volume_type.go index 58b91721a..90b314990 100644 --- a/services/ske/model_volume_type.go +++ b/services/ske/model_volume_type.go @@ -17,9 +17,30 @@ import ( // checks if the VolumeType type satisfies the MappedNullable interface at compile time var _ MappedNullable = &VolumeType{} +/* + types and functions for name +*/ + +// isNotNullableString +type VolumeTypeGetNameAttributeType = *string + +func getVolumeTypeGetNameAttributeTypeOk(arg VolumeTypeGetNameAttributeType) (ret VolumeTypeGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setVolumeTypeGetNameAttributeType(arg *VolumeTypeGetNameAttributeType, val VolumeTypeGetNameRetType) { + *arg = &val +} + +type VolumeTypeGetNameArgType = string +type VolumeTypeGetNameRetType = string + // VolumeType struct for VolumeType type VolumeType struct { - Name *string `json:"name,omitempty"` + Name VolumeTypeGetNameAttributeType `json:"name,omitempty"` } // NewVolumeType instantiates a new VolumeType object @@ -40,41 +61,32 @@ func NewVolumeTypeWithDefaults() *VolumeType { } // GetName returns the Name field value if set, zero value otherwise. -func (o *VolumeType) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *VolumeType) GetName() (res VolumeTypeGetNameRetType) { + 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 *VolumeType) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *VolumeType) GetNameOk() (ret VolumeTypeGetNameRetType, ok bool) { + return getVolumeTypeGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *VolumeType) 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 *VolumeType) SetName(v *string) { - o.Name = v +func (o *VolumeType) SetName(v VolumeTypeGetNameRetType) { + setVolumeTypeGetNameAttributeType(&o.Name, v) } func (o VolumeType) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getVolumeTypeGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } return toSerialize, nil } diff --git a/services/ske/utils.go b/services/ske/utils.go index 5a2330c7b..4799ce09d 100644 --- a/services/ske/utils.go +++ b/services/ske/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()