From f5653bae486d118c8cdd6c620b2028407668ee4f Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Tue, 18 Mar 2025 08:08:44 +0000 Subject: [PATCH] Generate serviceenablement --- .../serviceenablement/api_default_test.go | 64 +-- .../serviceenablement/model_action_error.go | 161 +++--- .../serviceenablement/model_check_service.go | 163 +++--- .../serviceenablement/model_cloud_service.go | 215 ++++---- .../serviceenablement/model_dependencies.go | 106 ++-- .../serviceenablement/model_error_response.go | 268 ++++++---- ...st_service_status_regional_200_response.go | 107 ++-- .../serviceenablement/model_parameters.go | 53 +- .../model_parameters_general.go | 163 +++--- .../serviceenablement/model_service_status.go | 486 +++++++++++------- services/serviceenablement/utils.go | 26 + 11 files changed, 1094 insertions(+), 718 deletions(-) diff --git a/services/serviceenablement/api_default_test.go b/services/serviceenablement/api_default_test.go index 63291fe55..9a148d337 100644 --- a/services/serviceenablement/api_default_test.go +++ b/services/serviceenablement/api_default_test.go @@ -24,16 +24,16 @@ import ( func Test_serviceenablement_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService DisableServiceRegional", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/services/{serviceId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/services/{serviceId}" regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serviceIdValue := "serviceId" - path = strings.Replace(path, "{"+"serviceId"+"}", url.PathEscape(ParameterValueToString(serviceIdValue, "serviceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceId"+"}", url.PathEscape(ParameterValueToString(serviceIdValue, "serviceId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -64,9 +64,9 @@ func Test_serviceenablement_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - region := "region" - projectId := "projectId" - serviceId := "serviceId" + region := regionValue + projectId := projectIdValue + serviceId := serviceIdValue reqErr := apiClient.DisableServiceRegional(context.Background(), region, projectId, serviceId).Execute() @@ -76,16 +76,16 @@ func Test_serviceenablement_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService EnableServiceRegional", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/services/{serviceId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/services/{serviceId}" regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serviceIdValue := "serviceId" - path = strings.Replace(path, "{"+"serviceId"+"}", url.PathEscape(ParameterValueToString(serviceIdValue, "serviceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceId"+"}", url.PathEscape(ParameterValueToString(serviceIdValue, "serviceId")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { }) testServer := httptest.NewServer(testDefaultApiServeMux) defer testServer.Close() @@ -116,9 +116,9 @@ func Test_serviceenablement_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - region := "region" - projectId := "projectId" - serviceId := "serviceId" + region := regionValue + projectId := projectIdValue + serviceId := serviceIdValue reqErr := apiClient.EnableServiceRegional(context.Background(), region, projectId, serviceId).Execute() @@ -128,16 +128,16 @@ func Test_serviceenablement_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetServiceStatusRegional", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/services/{serviceId}" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/services/{serviceId}" regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) serviceIdValue := "serviceId" - path = strings.Replace(path, "{"+"serviceId"+"}", url.PathEscape(ParameterValueToString(serviceIdValue, "serviceId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"serviceId"+"}", url.PathEscape(ParameterValueToString(serviceIdValue, "serviceId")), -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 := ServiceStatus{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -171,29 +171,29 @@ func Test_serviceenablement_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - region := "region" - projectId := "projectId" - serviceId := "serviceId" + region := regionValue + projectId := projectIdValue + serviceId := serviceIdValue resp, reqErr := apiClient.GetServiceStatusRegional(context.Background(), region, projectId, serviceId).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 ListServiceStatusRegional", func(t *testing.T) { - path := "/v2/projects/{projectId}/regions/{region}/services" + _apiUrlPath := "/v2/projects/{projectId}/regions/{region}/services" regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) 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 := ListServiceStatusRegional200Response{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -227,15 +227,15 @@ func Test_serviceenablement_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - region := "region" - projectId := "projectId" + region := regionValue + projectId := projectIdValue resp, reqErr := apiClient.ListServiceStatusRegional(context.Background(), region, projectId).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/serviceenablement/model_action_error.go b/services/serviceenablement/model_action_error.go index eab4b32de..2d5f9e2c4 100644 --- a/services/serviceenablement/model_action_error.go +++ b/services/serviceenablement/model_action_error.go @@ -17,14 +17,76 @@ import ( // checks if the ActionError type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ActionError{} +/* + types and functions for action +*/ + +// isEnumRef +type ActionErrorGetActionAttributeType = *string +type ActionErrorGetActionArgType = string +type ActionErrorGetActionRetType = string + +func getActionErrorGetActionAttributeTypeOk(arg ActionErrorGetActionAttributeType) (ret ActionErrorGetActionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setActionErrorGetActionAttributeType(arg *ActionErrorGetActionAttributeType, val ActionErrorGetActionRetType) { + *arg = &val +} + +/* + types and functions for code +*/ + +// isNotNullableString +type ActionErrorGetCodeAttributeType = *string + +func getActionErrorGetCodeAttributeTypeOk(arg ActionErrorGetCodeAttributeType) (ret ActionErrorGetCodeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setActionErrorGetCodeAttributeType(arg *ActionErrorGetCodeAttributeType, val ActionErrorGetCodeRetType) { + *arg = &val +} + +type ActionErrorGetCodeArgType = string +type ActionErrorGetCodeRetType = string + +/* + types and functions for reason +*/ + +// isNotNullableString +type ActionErrorGetReasonAttributeType = *string + +func getActionErrorGetReasonAttributeTypeOk(arg ActionErrorGetReasonAttributeType) (ret ActionErrorGetReasonRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setActionErrorGetReasonAttributeType(arg *ActionErrorGetReasonAttributeType, val ActionErrorGetReasonRetType) { + *arg = &val +} + +type ActionErrorGetReasonArgType = string +type ActionErrorGetReasonRetType = string + // ActionError the last error for this service. type ActionError struct { // the last action which was triggered on this service - Action *string `json:"action,omitempty"` + Action ActionErrorGetActionAttributeType `json:"action,omitempty"` // the error code if provided by the service - Code *string `json:"code,omitempty"` + Code ActionErrorGetCodeAttributeType `json:"code,omitempty"` // the error reason provided by the service - Reason *string `json:"reason,omitempty"` + Reason ActionErrorGetReasonAttributeType `json:"reason,omitempty"` } // NewActionError instantiates a new ActionError object @@ -45,111 +107,84 @@ func NewActionErrorWithDefaults() *ActionError { } // GetAction returns the Action field value if set, zero value otherwise. -func (o *ActionError) GetAction() *string { - if o == nil || IsNil(o.Action) { - var ret *string - return ret - } - return o.Action +func (o *ActionError) GetAction() (res ActionErrorGetActionRetType) { + res, _ = o.GetActionOk() + return } // GetActionOk returns a tuple with the Action field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ActionError) GetActionOk() (*string, bool) { - if o == nil || IsNil(o.Action) { - return nil, false - } - return o.Action, true +func (o *ActionError) GetActionOk() (ret ActionErrorGetActionRetType, ok bool) { + return getActionErrorGetActionAttributeTypeOk(o.Action) } // HasAction returns a boolean if a field has been set. func (o *ActionError) HasAction() bool { - if o != nil && !IsNil(o.Action) { - return true - } - - return false + _, ok := o.GetActionOk() + return ok } // SetAction gets a reference to the given string and assigns it to the Action field. -func (o *ActionError) SetAction(v *string) { - o.Action = v +func (o *ActionError) SetAction(v ActionErrorGetActionRetType) { + setActionErrorGetActionAttributeType(&o.Action, v) } // GetCode returns the Code field value if set, zero value otherwise. -func (o *ActionError) GetCode() *string { - if o == nil || IsNil(o.Code) { - var ret *string - return ret - } - return o.Code +func (o *ActionError) GetCode() (res ActionErrorGetCodeRetType) { + 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 *ActionError) GetCodeOk() (*string, bool) { - if o == nil || IsNil(o.Code) { - return nil, false - } - return o.Code, true +func (o *ActionError) GetCodeOk() (ret ActionErrorGetCodeRetType, ok bool) { + return getActionErrorGetCodeAttributeTypeOk(o.Code) } // HasCode returns a boolean if a field has been set. func (o *ActionError) 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 *ActionError) SetCode(v *string) { - o.Code = v +func (o *ActionError) SetCode(v ActionErrorGetCodeRetType) { + setActionErrorGetCodeAttributeType(&o.Code, v) } // GetReason returns the Reason field value if set, zero value otherwise. -func (o *ActionError) GetReason() *string { - if o == nil || IsNil(o.Reason) { - var ret *string - return ret - } - return o.Reason +func (o *ActionError) GetReason() (res ActionErrorGetReasonRetType) { + res, _ = o.GetReasonOk() + return } // GetReasonOk returns a tuple with the Reason field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ActionError) GetReasonOk() (*string, bool) { - if o == nil || IsNil(o.Reason) { - return nil, false - } - return o.Reason, true +func (o *ActionError) GetReasonOk() (ret ActionErrorGetReasonRetType, ok bool) { + return getActionErrorGetReasonAttributeTypeOk(o.Reason) } // HasReason returns a boolean if a field has been set. func (o *ActionError) HasReason() bool { - if o != nil && !IsNil(o.Reason) { - return true - } - - return false + _, ok := o.GetReasonOk() + return ok } // SetReason gets a reference to the given string and assigns it to the Reason field. -func (o *ActionError) SetReason(v *string) { - o.Reason = v +func (o *ActionError) SetReason(v ActionErrorGetReasonRetType) { + setActionErrorGetReasonAttributeType(&o.Reason, v) } func (o ActionError) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Action) { - toSerialize["action"] = o.Action + if val, ok := getActionErrorGetActionAttributeTypeOk(o.Action); ok { + toSerialize["Action"] = val } - if !IsNil(o.Code) { - toSerialize["code"] = o.Code + if val, ok := getActionErrorGetCodeAttributeTypeOk(o.Code); ok { + toSerialize["Code"] = val } - if !IsNil(o.Reason) { - toSerialize["reason"] = o.Reason + if val, ok := getActionErrorGetReasonAttributeTypeOk(o.Reason); ok { + toSerialize["Reason"] = val } return toSerialize, nil } diff --git a/services/serviceenablement/model_check_service.go b/services/serviceenablement/model_check_service.go index b52edb1e2..2ab976d0f 100644 --- a/services/serviceenablement/model_check_service.go +++ b/services/serviceenablement/model_check_service.go @@ -17,13 +17,75 @@ import ( // checks if the CheckService type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CheckService{} +/* + types and functions for resource +*/ + +// isNotNullableString +type CheckServiceGetResourceAttributeType = *string + +func getCheckServiceGetResourceAttributeTypeOk(arg CheckServiceGetResourceAttributeType) (ret CheckServiceGetResourceRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCheckServiceGetResourceAttributeType(arg *CheckServiceGetResourceAttributeType, val CheckServiceGetResourceRetType) { + *arg = &val +} + +type CheckServiceGetResourceArgType = string +type CheckServiceGetResourceRetType = string + +/* + types and functions for resourceType +*/ + +// isEnumRef +type CheckServiceGetResourceTypeAttributeType = *string +type CheckServiceGetResourceTypeArgType = string +type CheckServiceGetResourceTypeRetType = string + +func getCheckServiceGetResourceTypeAttributeTypeOk(arg CheckServiceGetResourceTypeAttributeType) (ret CheckServiceGetResourceTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCheckServiceGetResourceTypeAttributeType(arg *CheckServiceGetResourceTypeAttributeType, val CheckServiceGetResourceTypeRetType) { + *arg = &val +} + +/* + types and functions for serviceId +*/ + +// isNotNullableString +type CheckServiceGetServiceIdAttributeType = *string + +func getCheckServiceGetServiceIdAttributeTypeOk(arg CheckServiceGetServiceIdAttributeType) (ret CheckServiceGetServiceIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCheckServiceGetServiceIdAttributeType(arg *CheckServiceGetServiceIdAttributeType, val CheckServiceGetServiceIdRetType) { + *arg = &val +} + +type CheckServiceGetServiceIdArgType = string +type CheckServiceGetServiceIdRetType = string + // CheckService struct for CheckService type CheckService struct { // the identifier of the resource e.g. projectID - Resource *string `json:"resource,omitempty"` - ResourceType *string `json:"resourceType,omitempty"` + Resource CheckServiceGetResourceAttributeType `json:"resource,omitempty"` + ResourceType CheckServiceGetResourceTypeAttributeType `json:"resourceType,omitempty"` // the id of the service - ServiceId *string `json:"serviceId,omitempty"` + ServiceId CheckServiceGetServiceIdAttributeType `json:"serviceId,omitempty"` } // NewCheckService instantiates a new CheckService object @@ -32,8 +94,6 @@ type CheckService struct { // will change when the set of required properties is changed func NewCheckService() *CheckService { this := CheckService{} - var resourceType string = "project" - this.ResourceType = &resourceType return &this } @@ -48,111 +108,84 @@ func NewCheckServiceWithDefaults() *CheckService { } // GetResource returns the Resource field value if set, zero value otherwise. -func (o *CheckService) GetResource() *string { - if o == nil || IsNil(o.Resource) { - var ret *string - return ret - } - return o.Resource +func (o *CheckService) GetResource() (res CheckServiceGetResourceRetType) { + res, _ = o.GetResourceOk() + return } // GetResourceOk returns a tuple with the Resource field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckService) GetResourceOk() (*string, bool) { - if o == nil || IsNil(o.Resource) { - return nil, false - } - return o.Resource, true +func (o *CheckService) GetResourceOk() (ret CheckServiceGetResourceRetType, ok bool) { + return getCheckServiceGetResourceAttributeTypeOk(o.Resource) } // HasResource returns a boolean if a field has been set. func (o *CheckService) HasResource() bool { - if o != nil && !IsNil(o.Resource) { - return true - } - - return false + _, ok := o.GetResourceOk() + return ok } // SetResource gets a reference to the given string and assigns it to the Resource field. -func (o *CheckService) SetResource(v *string) { - o.Resource = v +func (o *CheckService) SetResource(v CheckServiceGetResourceRetType) { + setCheckServiceGetResourceAttributeType(&o.Resource, v) } // GetResourceType returns the ResourceType field value if set, zero value otherwise. -func (o *CheckService) GetResourceType() *string { - if o == nil || IsNil(o.ResourceType) { - var ret *string - return ret - } - return o.ResourceType +func (o *CheckService) GetResourceType() (res CheckServiceGetResourceTypeRetType) { + res, _ = o.GetResourceTypeOk() + return } // GetResourceTypeOk returns a tuple with the ResourceType field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckService) GetResourceTypeOk() (*string, bool) { - if o == nil || IsNil(o.ResourceType) { - return nil, false - } - return o.ResourceType, true +func (o *CheckService) GetResourceTypeOk() (ret CheckServiceGetResourceTypeRetType, ok bool) { + return getCheckServiceGetResourceTypeAttributeTypeOk(o.ResourceType) } // HasResourceType returns a boolean if a field has been set. func (o *CheckService) HasResourceType() bool { - if o != nil && !IsNil(o.ResourceType) { - return true - } - - return false + _, ok := o.GetResourceTypeOk() + return ok } // SetResourceType gets a reference to the given string and assigns it to the ResourceType field. -func (o *CheckService) SetResourceType(v *string) { - o.ResourceType = v +func (o *CheckService) SetResourceType(v CheckServiceGetResourceTypeRetType) { + setCheckServiceGetResourceTypeAttributeType(&o.ResourceType, v) } // GetServiceId returns the ServiceId field value if set, zero value otherwise. -func (o *CheckService) GetServiceId() *string { - if o == nil || IsNil(o.ServiceId) { - var ret *string - return ret - } - return o.ServiceId +func (o *CheckService) GetServiceId() (res CheckServiceGetServiceIdRetType) { + res, _ = o.GetServiceIdOk() + return } // GetServiceIdOk returns a tuple with the ServiceId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CheckService) GetServiceIdOk() (*string, bool) { - if o == nil || IsNil(o.ServiceId) { - return nil, false - } - return o.ServiceId, true +func (o *CheckService) GetServiceIdOk() (ret CheckServiceGetServiceIdRetType, ok bool) { + return getCheckServiceGetServiceIdAttributeTypeOk(o.ServiceId) } // HasServiceId returns a boolean if a field has been set. func (o *CheckService) HasServiceId() bool { - if o != nil && !IsNil(o.ServiceId) { - return true - } - - return false + _, ok := o.GetServiceIdOk() + return ok } // SetServiceId gets a reference to the given string and assigns it to the ServiceId field. -func (o *CheckService) SetServiceId(v *string) { - o.ServiceId = v +func (o *CheckService) SetServiceId(v CheckServiceGetServiceIdRetType) { + setCheckServiceGetServiceIdAttributeType(&o.ServiceId, v) } func (o CheckService) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Resource) { - toSerialize["resource"] = o.Resource + if val, ok := getCheckServiceGetResourceAttributeTypeOk(o.Resource); ok { + toSerialize["Resource"] = val } - if !IsNil(o.ResourceType) { - toSerialize["resourceType"] = o.ResourceType + if val, ok := getCheckServiceGetResourceTypeAttributeTypeOk(o.ResourceType); ok { + toSerialize["ResourceType"] = val } - if !IsNil(o.ServiceId) { - toSerialize["serviceId"] = o.ServiceId + if val, ok := getCheckServiceGetServiceIdAttributeTypeOk(o.ServiceId); ok { + toSerialize["ServiceId"] = val } return toSerialize, nil } diff --git a/services/serviceenablement/model_cloud_service.go b/services/serviceenablement/model_cloud_service.go index b956a735b..a08edd5f2 100644 --- a/services/serviceenablement/model_cloud_service.go +++ b/services/serviceenablement/model_cloud_service.go @@ -17,13 +17,94 @@ import ( // checks if the CloudService type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CloudService{} +/* + types and functions for dependencies +*/ + +// isModel +type CloudServiceGetDependenciesAttributeType = *Dependencies +type CloudServiceGetDependenciesArgType = Dependencies +type CloudServiceGetDependenciesRetType = Dependencies + +func getCloudServiceGetDependenciesAttributeTypeOk(arg CloudServiceGetDependenciesAttributeType) (ret CloudServiceGetDependenciesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCloudServiceGetDependenciesAttributeType(arg *CloudServiceGetDependenciesAttributeType, val CloudServiceGetDependenciesRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isContainer +type CloudServiceGetLabelsAttributeType = *map[string]string +type CloudServiceGetLabelsArgType = map[string]string +type CloudServiceGetLabelsRetType = map[string]string + +func getCloudServiceGetLabelsAttributeTypeOk(arg CloudServiceGetLabelsAttributeType) (ret CloudServiceGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCloudServiceGetLabelsAttributeType(arg *CloudServiceGetLabelsAttributeType, val CloudServiceGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for scope +*/ + +// isEnumRef +type CloudServiceGetScopeAttributeType = *string +type CloudServiceGetScopeArgType = string +type CloudServiceGetScopeRetType = string + +func getCloudServiceGetScopeAttributeTypeOk(arg CloudServiceGetScopeAttributeType) (ret CloudServiceGetScopeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCloudServiceGetScopeAttributeType(arg *CloudServiceGetScopeAttributeType, val CloudServiceGetScopeRetType) { + *arg = &val +} + +/* + types and functions for serviceId +*/ + +// isNotNullableString +type CloudServiceGetServiceIdAttributeType = *string + +func getCloudServiceGetServiceIdAttributeTypeOk(arg CloudServiceGetServiceIdAttributeType) (ret CloudServiceGetServiceIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCloudServiceGetServiceIdAttributeType(arg *CloudServiceGetServiceIdAttributeType, val CloudServiceGetServiceIdRetType) { + *arg = &val +} + +type CloudServiceGetServiceIdArgType = string +type CloudServiceGetServiceIdRetType = string + // CloudService struct for CloudService type CloudService struct { - Dependencies *Dependencies `json:"dependencies,omitempty"` - Labels *map[string]string `json:"labels,omitempty"` - Scope *string `json:"scope,omitempty"` + Dependencies CloudServiceGetDependenciesAttributeType `json:"dependencies,omitempty"` + Labels CloudServiceGetLabelsAttributeType `json:"labels,omitempty"` + Scope CloudServiceGetScopeAttributeType `json:"scope,omitempty"` // the id of the service - ServiceId *string `json:"serviceId,omitempty"` + ServiceId CloudServiceGetServiceIdAttributeType `json:"serviceId,omitempty"` } // NewCloudService instantiates a new CloudService object @@ -32,8 +113,6 @@ type CloudService struct { // will change when the set of required properties is changed func NewCloudService() *CloudService { this := CloudService{} - var scope string = "PUBLIC" - this.Scope = &scope return &this } @@ -48,146 +127,110 @@ func NewCloudServiceWithDefaults() *CloudService { } // GetDependencies returns the Dependencies field value if set, zero value otherwise. -func (o *CloudService) GetDependencies() *Dependencies { - if o == nil || IsNil(o.Dependencies) { - var ret *Dependencies - return ret - } - return o.Dependencies +func (o *CloudService) GetDependencies() (res CloudServiceGetDependenciesRetType) { + res, _ = o.GetDependenciesOk() + return } // GetDependenciesOk returns a tuple with the Dependencies field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CloudService) GetDependenciesOk() (*Dependencies, bool) { - if o == nil || IsNil(o.Dependencies) { - return nil, false - } - return o.Dependencies, true +func (o *CloudService) GetDependenciesOk() (ret CloudServiceGetDependenciesRetType, ok bool) { + return getCloudServiceGetDependenciesAttributeTypeOk(o.Dependencies) } // HasDependencies returns a boolean if a field has been set. func (o *CloudService) HasDependencies() bool { - if o != nil && !IsNil(o.Dependencies) { - return true - } - - return false + _, ok := o.GetDependenciesOk() + return ok } // SetDependencies gets a reference to the given Dependencies and assigns it to the Dependencies field. -func (o *CloudService) SetDependencies(v *Dependencies) { - o.Dependencies = v +func (o *CloudService) SetDependencies(v CloudServiceGetDependenciesRetType) { + setCloudServiceGetDependenciesAttributeType(&o.Dependencies, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CloudService) GetLabels() *map[string]string { - if o == nil || IsNil(o.Labels) { - var ret *map[string]string - return ret - } - return o.Labels +func (o *CloudService) GetLabels() (res CloudServiceGetLabelsRetType) { + 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 *CloudService) GetLabelsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Labels) { - return nil, false - } - return o.Labels, true +func (o *CloudService) GetLabelsOk() (ret CloudServiceGetLabelsRetType, ok bool) { + return getCloudServiceGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *CloudService) 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 *CloudService) SetLabels(v *map[string]string) { - o.Labels = v +func (o *CloudService) SetLabels(v CloudServiceGetLabelsRetType) { + setCloudServiceGetLabelsAttributeType(&o.Labels, v) } // GetScope returns the Scope field value if set, zero value otherwise. -func (o *CloudService) GetScope() *string { - if o == nil || IsNil(o.Scope) { - var ret *string - return ret - } - return o.Scope +func (o *CloudService) GetScope() (res CloudServiceGetScopeRetType) { + res, _ = o.GetScopeOk() + return } // GetScopeOk returns a tuple with the Scope field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CloudService) GetScopeOk() (*string, bool) { - if o == nil || IsNil(o.Scope) { - return nil, false - } - return o.Scope, true +func (o *CloudService) GetScopeOk() (ret CloudServiceGetScopeRetType, ok bool) { + return getCloudServiceGetScopeAttributeTypeOk(o.Scope) } // HasScope returns a boolean if a field has been set. func (o *CloudService) HasScope() bool { - if o != nil && !IsNil(o.Scope) { - return true - } - - return false + _, ok := o.GetScopeOk() + return ok } // SetScope gets a reference to the given string and assigns it to the Scope field. -func (o *CloudService) SetScope(v *string) { - o.Scope = v +func (o *CloudService) SetScope(v CloudServiceGetScopeRetType) { + setCloudServiceGetScopeAttributeType(&o.Scope, v) } // GetServiceId returns the ServiceId field value if set, zero value otherwise. -func (o *CloudService) GetServiceId() *string { - if o == nil || IsNil(o.ServiceId) { - var ret *string - return ret - } - return o.ServiceId +func (o *CloudService) GetServiceId() (res CloudServiceGetServiceIdRetType) { + res, _ = o.GetServiceIdOk() + return } // GetServiceIdOk returns a tuple with the ServiceId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CloudService) GetServiceIdOk() (*string, bool) { - if o == nil || IsNil(o.ServiceId) { - return nil, false - } - return o.ServiceId, true +func (o *CloudService) GetServiceIdOk() (ret CloudServiceGetServiceIdRetType, ok bool) { + return getCloudServiceGetServiceIdAttributeTypeOk(o.ServiceId) } // HasServiceId returns a boolean if a field has been set. func (o *CloudService) HasServiceId() bool { - if o != nil && !IsNil(o.ServiceId) { - return true - } - - return false + _, ok := o.GetServiceIdOk() + return ok } // SetServiceId gets a reference to the given string and assigns it to the ServiceId field. -func (o *CloudService) SetServiceId(v *string) { - o.ServiceId = v +func (o *CloudService) SetServiceId(v CloudServiceGetServiceIdRetType) { + setCloudServiceGetServiceIdAttributeType(&o.ServiceId, v) } func (o CloudService) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Dependencies) { - toSerialize["dependencies"] = o.Dependencies + if val, ok := getCloudServiceGetDependenciesAttributeTypeOk(o.Dependencies); ok { + toSerialize["Dependencies"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getCloudServiceGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Scope) { - toSerialize["scope"] = o.Scope + if val, ok := getCloudServiceGetScopeAttributeTypeOk(o.Scope); ok { + toSerialize["Scope"] = val } - if !IsNil(o.ServiceId) { - toSerialize["serviceId"] = o.ServiceId + if val, ok := getCloudServiceGetServiceIdAttributeTypeOk(o.ServiceId); ok { + toSerialize["ServiceId"] = val } return toSerialize, nil } diff --git a/services/serviceenablement/model_dependencies.go b/services/serviceenablement/model_dependencies.go index bac5fbfc1..113e2e52e 100644 --- a/services/serviceenablement/model_dependencies.go +++ b/services/serviceenablement/model_dependencies.go @@ -17,12 +17,52 @@ import ( // checks if the Dependencies type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Dependencies{} +/* + types and functions for hard +*/ + +// isArray +type DependenciesGetHardAttributeType = *[]string +type DependenciesGetHardArgType = []string +type DependenciesGetHardRetType = []string + +func getDependenciesGetHardAttributeTypeOk(arg DependenciesGetHardAttributeType) (ret DependenciesGetHardRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDependenciesGetHardAttributeType(arg *DependenciesGetHardAttributeType, val DependenciesGetHardRetType) { + *arg = &val +} + +/* + types and functions for soft +*/ + +// isArray +type DependenciesGetSoftAttributeType = *[]string +type DependenciesGetSoftArgType = []string +type DependenciesGetSoftRetType = []string + +func getDependenciesGetSoftAttributeTypeOk(arg DependenciesGetSoftAttributeType) (ret DependenciesGetSoftRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDependenciesGetSoftAttributeType(arg *DependenciesGetSoftAttributeType, val DependenciesGetSoftRetType) { + *arg = &val +} + // Dependencies struct for Dependencies type Dependencies struct { // a list of service IDs which this service depend on. If the service is enabled, those service are enabled as well automatically. - Hard *[]string `json:"hard,omitempty"` + Hard DependenciesGetHardAttributeType `json:"hard,omitempty"` // a list of service IDs which this service depend on. When they are disabled a notification is sent. - Soft *[]string `json:"soft,omitempty"` + Soft DependenciesGetSoftAttributeType `json:"soft,omitempty"` } // NewDependencies instantiates a new Dependencies object @@ -43,76 +83,58 @@ func NewDependenciesWithDefaults() *Dependencies { } // GetHard returns the Hard field value if set, zero value otherwise. -func (o *Dependencies) GetHard() *[]string { - if o == nil || IsNil(o.Hard) { - var ret *[]string - return ret - } - return o.Hard +func (o *Dependencies) GetHard() (res DependenciesGetHardRetType) { + res, _ = o.GetHardOk() + return } // GetHardOk returns a tuple with the Hard field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Dependencies) GetHardOk() (*[]string, bool) { - if o == nil || IsNil(o.Hard) { - return nil, false - } - return o.Hard, true +func (o *Dependencies) GetHardOk() (ret DependenciesGetHardRetType, ok bool) { + return getDependenciesGetHardAttributeTypeOk(o.Hard) } // HasHard returns a boolean if a field has been set. func (o *Dependencies) HasHard() bool { - if o != nil && !IsNil(o.Hard) { - return true - } - - return false + _, ok := o.GetHardOk() + return ok } // SetHard gets a reference to the given []string and assigns it to the Hard field. -func (o *Dependencies) SetHard(v *[]string) { - o.Hard = v +func (o *Dependencies) SetHard(v DependenciesGetHardRetType) { + setDependenciesGetHardAttributeType(&o.Hard, v) } // GetSoft returns the Soft field value if set, zero value otherwise. -func (o *Dependencies) GetSoft() *[]string { - if o == nil || IsNil(o.Soft) { - var ret *[]string - return ret - } - return o.Soft +func (o *Dependencies) GetSoft() (res DependenciesGetSoftRetType) { + res, _ = o.GetSoftOk() + return } // GetSoftOk returns a tuple with the Soft field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Dependencies) GetSoftOk() (*[]string, bool) { - if o == nil || IsNil(o.Soft) { - return nil, false - } - return o.Soft, true +func (o *Dependencies) GetSoftOk() (ret DependenciesGetSoftRetType, ok bool) { + return getDependenciesGetSoftAttributeTypeOk(o.Soft) } // HasSoft returns a boolean if a field has been set. func (o *Dependencies) HasSoft() bool { - if o != nil && !IsNil(o.Soft) { - return true - } - - return false + _, ok := o.GetSoftOk() + return ok } // SetSoft gets a reference to the given []string and assigns it to the Soft field. -func (o *Dependencies) SetSoft(v *[]string) { - o.Soft = v +func (o *Dependencies) SetSoft(v DependenciesGetSoftRetType) { + setDependenciesGetSoftAttributeType(&o.Soft, v) } func (o Dependencies) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Hard) { - toSerialize["hard"] = o.Hard + if val, ok := getDependenciesGetHardAttributeTypeOk(o.Hard); ok { + toSerialize["Hard"] = val } - if !IsNil(o.Soft) { - toSerialize["soft"] = o.Soft + if val, ok := getDependenciesGetSoftAttributeTypeOk(o.Soft); ok { + toSerialize["Soft"] = val } return toSerialize, nil } diff --git a/services/serviceenablement/model_error_response.go b/services/serviceenablement/model_error_response.go index 413b0b53f..81ab6001a 100644 --- a/services/serviceenablement/model_error_response.go +++ b/services/serviceenablement/model_error_response.go @@ -18,14 +18,117 @@ import ( // checks if the ErrorResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ErrorResponse{} +/* + types and functions for error +*/ + +// isNotNullableString +type ErrorResponseGetErrorAttributeType = *string + +func getErrorResponseGetErrorAttributeTypeOk(arg ErrorResponseGetErrorAttributeType) (ret ErrorResponseGetErrorRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorResponseGetErrorAttributeType(arg *ErrorResponseGetErrorAttributeType, val ErrorResponseGetErrorRetType) { + *arg = &val +} + +type ErrorResponseGetErrorArgType = string +type ErrorResponseGetErrorRetType = string + +/* + types and functions for message +*/ + +// isNotNullableString +type ErrorResponseGetMessageAttributeType = *string + +func getErrorResponseGetMessageAttributeTypeOk(arg ErrorResponseGetMessageAttributeType) (ret ErrorResponseGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorResponseGetMessageAttributeType(arg *ErrorResponseGetMessageAttributeType, val ErrorResponseGetMessageRetType) { + *arg = &val +} + +type ErrorResponseGetMessageArgType = string +type ErrorResponseGetMessageRetType = string + +/* + types and functions for path +*/ + +// isNotNullableString +type ErrorResponseGetPathAttributeType = *string + +func getErrorResponseGetPathAttributeTypeOk(arg ErrorResponseGetPathAttributeType) (ret ErrorResponseGetPathRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorResponseGetPathAttributeType(arg *ErrorResponseGetPathAttributeType, val ErrorResponseGetPathRetType) { + *arg = &val +} + +type ErrorResponseGetPathArgType = string +type ErrorResponseGetPathRetType = string + +/* + types and functions for status +*/ + +// isInteger +type ErrorResponseGetStatusAttributeType = *int64 +type ErrorResponseGetStatusArgType = int64 +type ErrorResponseGetStatusRetType = int64 + +func getErrorResponseGetStatusAttributeTypeOk(arg ErrorResponseGetStatusAttributeType) (ret ErrorResponseGetStatusRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorResponseGetStatusAttributeType(arg *ErrorResponseGetStatusAttributeType, val ErrorResponseGetStatusRetType) { + *arg = &val +} + +/* + types and functions for timestamp +*/ + +// isDateTime +type ErrorResponseGetTimestampAttributeType = *time.Time +type ErrorResponseGetTimestampArgType = time.Time +type ErrorResponseGetTimestampRetType = time.Time + +func getErrorResponseGetTimestampAttributeTypeOk(arg ErrorResponseGetTimestampAttributeType) (ret ErrorResponseGetTimestampRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorResponseGetTimestampAttributeType(arg *ErrorResponseGetTimestampAttributeType, val ErrorResponseGetTimestampRetType) { + *arg = &val +} + // ErrorResponse struct for ErrorResponse type ErrorResponse struct { - Error *string `json:"error,omitempty"` - Message *string `json:"message,omitempty"` - Path *string `json:"path,omitempty"` + Error ErrorResponseGetErrorAttributeType `json:"error,omitempty"` + Message ErrorResponseGetMessageAttributeType `json:"message,omitempty"` + Path ErrorResponseGetPathAttributeType `json:"path,omitempty"` // Can be cast to int32 without loss of precision. - Status *int64 `json:"status,omitempty"` - Timestamp *time.Time `json:"timestamp,omitempty"` + Status ErrorResponseGetStatusAttributeType `json:"status,omitempty"` + Timestamp ErrorResponseGetTimestampAttributeType `json:"timestamp,omitempty"` } // NewErrorResponse instantiates a new ErrorResponse object @@ -46,181 +149,136 @@ func NewErrorResponseWithDefaults() *ErrorResponse { } // GetError returns the Error field value if set, zero value otherwise. -func (o *ErrorResponse) GetError() *string { - if o == nil || IsNil(o.Error) { - var ret *string - return ret - } - return o.Error +func (o *ErrorResponse) GetError() (res ErrorResponseGetErrorRetType) { + 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 *ErrorResponse) GetErrorOk() (*string, bool) { - if o == nil || IsNil(o.Error) { - return nil, false - } - return o.Error, true +func (o *ErrorResponse) GetErrorOk() (ret ErrorResponseGetErrorRetType, ok bool) { + return getErrorResponseGetErrorAttributeTypeOk(o.Error) } // HasError returns a boolean if a field has been set. func (o *ErrorResponse) HasError() bool { - if o != nil && !IsNil(o.Error) { - return true - } - - return false + _, ok := o.GetErrorOk() + return ok } // SetError gets a reference to the given string and assigns it to the Error field. -func (o *ErrorResponse) SetError(v *string) { - o.Error = v +func (o *ErrorResponse) SetError(v ErrorResponseGetErrorRetType) { + setErrorResponseGetErrorAttributeType(&o.Error, v) } // GetMessage returns the Message field value if set, zero value otherwise. -func (o *ErrorResponse) GetMessage() *string { - if o == nil || IsNil(o.Message) { - var ret *string - return ret - } - return o.Message +func (o *ErrorResponse) GetMessage() (res ErrorResponseGetMessageRetType) { + 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 *ErrorResponse) GetMessageOk() (*string, bool) { - if o == nil || IsNil(o.Message) { - return nil, false - } - return o.Message, true +func (o *ErrorResponse) GetMessageOk() (ret ErrorResponseGetMessageRetType, ok bool) { + return getErrorResponseGetMessageAttributeTypeOk(o.Message) } // HasMessage returns a boolean if a field has been set. func (o *ErrorResponse) 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 *ErrorResponse) SetMessage(v *string) { - o.Message = v +func (o *ErrorResponse) SetMessage(v ErrorResponseGetMessageRetType) { + setErrorResponseGetMessageAttributeType(&o.Message, v) } // GetPath returns the Path field value if set, zero value otherwise. -func (o *ErrorResponse) GetPath() *string { - if o == nil || IsNil(o.Path) { - var ret *string - return ret - } - return o.Path +func (o *ErrorResponse) GetPath() (res ErrorResponseGetPathRetType) { + res, _ = o.GetPathOk() + return } // GetPathOk returns a tuple with the Path field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ErrorResponse) GetPathOk() (*string, bool) { - if o == nil || IsNil(o.Path) { - return nil, false - } - return o.Path, true +func (o *ErrorResponse) GetPathOk() (ret ErrorResponseGetPathRetType, ok bool) { + return getErrorResponseGetPathAttributeTypeOk(o.Path) } // HasPath returns a boolean if a field has been set. func (o *ErrorResponse) HasPath() bool { - if o != nil && !IsNil(o.Path) { - return true - } - - return false + _, ok := o.GetPathOk() + return ok } // SetPath gets a reference to the given string and assigns it to the Path field. -func (o *ErrorResponse) SetPath(v *string) { - o.Path = v +func (o *ErrorResponse) SetPath(v ErrorResponseGetPathRetType) { + setErrorResponseGetPathAttributeType(&o.Path, v) } // GetStatus returns the Status field value if set, zero value otherwise. -func (o *ErrorResponse) GetStatus() *int64 { - if o == nil || IsNil(o.Status) { - var ret *int64 - return ret - } - return o.Status +func (o *ErrorResponse) GetStatus() (res ErrorResponseGetStatusRetType) { + 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 *ErrorResponse) GetStatusOk() (*int64, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true +func (o *ErrorResponse) GetStatusOk() (ret ErrorResponseGetStatusRetType, ok bool) { + return getErrorResponseGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. func (o *ErrorResponse) HasStatus() bool { - if o != nil && !IsNil(o.Status) { - return true - } - - return false + _, ok := o.GetStatusOk() + return ok } // SetStatus gets a reference to the given int64 and assigns it to the Status field. -func (o *ErrorResponse) SetStatus(v *int64) { - o.Status = v +func (o *ErrorResponse) SetStatus(v ErrorResponseGetStatusRetType) { + setErrorResponseGetStatusAttributeType(&o.Status, v) } // GetTimestamp returns the Timestamp field value if set, zero value otherwise. -func (o *ErrorResponse) GetTimestamp() *time.Time { - if o == nil || IsNil(o.Timestamp) { - var ret *time.Time - return ret - } - return o.Timestamp +func (o *ErrorResponse) GetTimestamp() (res ErrorResponseGetTimestampRetType) { + res, _ = o.GetTimestampOk() + return } // GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ErrorResponse) GetTimestampOk() (*time.Time, bool) { - if o == nil || IsNil(o.Timestamp) { - return nil, false - } - return o.Timestamp, true +func (o *ErrorResponse) GetTimestampOk() (ret ErrorResponseGetTimestampRetType, ok bool) { + return getErrorResponseGetTimestampAttributeTypeOk(o.Timestamp) } // HasTimestamp returns a boolean if a field has been set. func (o *ErrorResponse) HasTimestamp() bool { - if o != nil && !IsNil(o.Timestamp) { - return true - } - - return false + _, ok := o.GetTimestampOk() + return ok } // SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. -func (o *ErrorResponse) SetTimestamp(v *time.Time) { - o.Timestamp = v +func (o *ErrorResponse) SetTimestamp(v ErrorResponseGetTimestampRetType) { + setErrorResponseGetTimestampAttributeType(&o.Timestamp, v) } func (o ErrorResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Error) { - toSerialize["error"] = o.Error + if val, ok := getErrorResponseGetErrorAttributeTypeOk(o.Error); ok { + toSerialize["Error"] = val } - if !IsNil(o.Message) { - toSerialize["message"] = o.Message + if val, ok := getErrorResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val } - if !IsNil(o.Path) { - toSerialize["path"] = o.Path + if val, ok := getErrorResponseGetPathAttributeTypeOk(o.Path); ok { + toSerialize["Path"] = val } - if !IsNil(o.Status) { - toSerialize["status"] = o.Status + if val, ok := getErrorResponseGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val } - if !IsNil(o.Timestamp) { - toSerialize["timestamp"] = o.Timestamp + if val, ok := getErrorResponseGetTimestampAttributeTypeOk(o.Timestamp); ok { + toSerialize["Timestamp"] = val } return toSerialize, nil } diff --git a/services/serviceenablement/model_list_service_status_regional_200_response.go b/services/serviceenablement/model_list_service_status_regional_200_response.go index 069b5ea79..7c33fc18d 100644 --- a/services/serviceenablement/model_list_service_status_regional_200_response.go +++ b/services/serviceenablement/model_list_service_status_regional_200_response.go @@ -17,10 +17,51 @@ import ( // checks if the ListServiceStatusRegional200Response type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListServiceStatusRegional200Response{} +/* + types and functions for items +*/ + +// isArray +type ListServiceStatusRegional200ResponseGetItemsAttributeType = *[]ServiceStatus +type ListServiceStatusRegional200ResponseGetItemsArgType = []ServiceStatus +type ListServiceStatusRegional200ResponseGetItemsRetType = []ServiceStatus + +func getListServiceStatusRegional200ResponseGetItemsAttributeTypeOk(arg ListServiceStatusRegional200ResponseGetItemsAttributeType) (ret ListServiceStatusRegional200ResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListServiceStatusRegional200ResponseGetItemsAttributeType(arg *ListServiceStatusRegional200ResponseGetItemsAttributeType, val ListServiceStatusRegional200ResponseGetItemsRetType) { + *arg = &val +} + +/* + types and functions for nextCursor +*/ + +// isNotNullableString +type ListServiceStatusRegional200ResponseGetNextCursorAttributeType = *string + +func getListServiceStatusRegional200ResponseGetNextCursorAttributeTypeOk(arg ListServiceStatusRegional200ResponseGetNextCursorAttributeType) (ret ListServiceStatusRegional200ResponseGetNextCursorRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListServiceStatusRegional200ResponseGetNextCursorAttributeType(arg *ListServiceStatusRegional200ResponseGetNextCursorAttributeType, val ListServiceStatusRegional200ResponseGetNextCursorRetType) { + *arg = &val +} + +type ListServiceStatusRegional200ResponseGetNextCursorArgType = string +type ListServiceStatusRegional200ResponseGetNextCursorRetType = string + // ListServiceStatusRegional200Response struct for ListServiceStatusRegional200Response type ListServiceStatusRegional200Response struct { - Items *[]ServiceStatus `json:"items,omitempty"` - NextCursor *string `json:"nextCursor,omitempty"` + Items ListServiceStatusRegional200ResponseGetItemsAttributeType `json:"items,omitempty"` + NextCursor ListServiceStatusRegional200ResponseGetNextCursorAttributeType `json:"nextCursor,omitempty"` } // NewListServiceStatusRegional200Response instantiates a new ListServiceStatusRegional200Response object @@ -41,76 +82,58 @@ func NewListServiceStatusRegional200ResponseWithDefaults() *ListServiceStatusReg } // GetItems returns the Items field value if set, zero value otherwise. -func (o *ListServiceStatusRegional200Response) GetItems() *[]ServiceStatus { - if o == nil || IsNil(o.Items) { - var ret *[]ServiceStatus - return ret - } - return o.Items +func (o *ListServiceStatusRegional200Response) GetItems() (res ListServiceStatusRegional200ResponseGetItemsRetType) { + 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 *ListServiceStatusRegional200Response) GetItemsOk() (*[]ServiceStatus, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true +func (o *ListServiceStatusRegional200Response) GetItemsOk() (ret ListServiceStatusRegional200ResponseGetItemsRetType, ok bool) { + return getListServiceStatusRegional200ResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. func (o *ListServiceStatusRegional200Response) HasItems() bool { - if o != nil && !IsNil(o.Items) { - return true - } - - return false + _, ok := o.GetItemsOk() + return ok } // SetItems gets a reference to the given []ServiceStatus and assigns it to the Items field. -func (o *ListServiceStatusRegional200Response) SetItems(v *[]ServiceStatus) { - o.Items = v +func (o *ListServiceStatusRegional200Response) SetItems(v ListServiceStatusRegional200ResponseGetItemsRetType) { + setListServiceStatusRegional200ResponseGetItemsAttributeType(&o.Items, v) } // GetNextCursor returns the NextCursor field value if set, zero value otherwise. -func (o *ListServiceStatusRegional200Response) GetNextCursor() *string { - if o == nil || IsNil(o.NextCursor) { - var ret *string - return ret - } - return o.NextCursor +func (o *ListServiceStatusRegional200Response) GetNextCursor() (res ListServiceStatusRegional200ResponseGetNextCursorRetType) { + res, _ = o.GetNextCursorOk() + return } // GetNextCursorOk returns a tuple with the NextCursor field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListServiceStatusRegional200Response) GetNextCursorOk() (*string, bool) { - if o == nil || IsNil(o.NextCursor) { - return nil, false - } - return o.NextCursor, true +func (o *ListServiceStatusRegional200Response) GetNextCursorOk() (ret ListServiceStatusRegional200ResponseGetNextCursorRetType, ok bool) { + return getListServiceStatusRegional200ResponseGetNextCursorAttributeTypeOk(o.NextCursor) } // HasNextCursor returns a boolean if a field has been set. func (o *ListServiceStatusRegional200Response) HasNextCursor() bool { - if o != nil && !IsNil(o.NextCursor) { - return true - } - - return false + _, ok := o.GetNextCursorOk() + return ok } // SetNextCursor gets a reference to the given string and assigns it to the NextCursor field. -func (o *ListServiceStatusRegional200Response) SetNextCursor(v *string) { - o.NextCursor = v +func (o *ListServiceStatusRegional200Response) SetNextCursor(v ListServiceStatusRegional200ResponseGetNextCursorRetType) { + setListServiceStatusRegional200ResponseGetNextCursorAttributeType(&o.NextCursor, v) } func (o ListServiceStatusRegional200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Items) { - toSerialize["items"] = o.Items + if val, ok := getListServiceStatusRegional200ResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val } - if !IsNil(o.NextCursor) { - toSerialize["nextCursor"] = o.NextCursor + if val, ok := getListServiceStatusRegional200ResponseGetNextCursorAttributeTypeOk(o.NextCursor); ok { + toSerialize["NextCursor"] = val } return toSerialize, nil } diff --git a/services/serviceenablement/model_parameters.go b/services/serviceenablement/model_parameters.go index e7ef5ab05..dd380ab2e 100644 --- a/services/serviceenablement/model_parameters.go +++ b/services/serviceenablement/model_parameters.go @@ -17,9 +17,29 @@ import ( // checks if the Parameters type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Parameters{} +/* + types and functions for general +*/ + +// isModel +type ParametersGetGeneralAttributeType = *ParametersGeneral +type ParametersGetGeneralArgType = ParametersGeneral +type ParametersGetGeneralRetType = ParametersGeneral + +func getParametersGetGeneralAttributeTypeOk(arg ParametersGetGeneralAttributeType) (ret ParametersGetGeneralRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setParametersGetGeneralAttributeType(arg *ParametersGetGeneralAttributeType, val ParametersGetGeneralRetType) { + *arg = &val +} + // Parameters service parameters type Parameters struct { - General *ParametersGeneral `json:"general,omitempty"` + General ParametersGetGeneralAttributeType `json:"general,omitempty"` } // NewParameters instantiates a new Parameters object @@ -40,41 +60,32 @@ func NewParametersWithDefaults() *Parameters { } // GetGeneral returns the General field value if set, zero value otherwise. -func (o *Parameters) GetGeneral() *ParametersGeneral { - if o == nil || IsNil(o.General) { - var ret *ParametersGeneral - return ret - } - return o.General +func (o *Parameters) GetGeneral() (res ParametersGetGeneralRetType) { + res, _ = o.GetGeneralOk() + return } // GetGeneralOk returns a tuple with the General field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Parameters) GetGeneralOk() (*ParametersGeneral, bool) { - if o == nil || IsNil(o.General) { - return nil, false - } - return o.General, true +func (o *Parameters) GetGeneralOk() (ret ParametersGetGeneralRetType, ok bool) { + return getParametersGetGeneralAttributeTypeOk(o.General) } // HasGeneral returns a boolean if a field has been set. func (o *Parameters) HasGeneral() bool { - if o != nil && !IsNil(o.General) { - return true - } - - return false + _, ok := o.GetGeneralOk() + return ok } // SetGeneral gets a reference to the given ParametersGeneral and assigns it to the General field. -func (o *Parameters) SetGeneral(v *ParametersGeneral) { - o.General = v +func (o *Parameters) SetGeneral(v ParametersGetGeneralRetType) { + setParametersGetGeneralAttributeType(&o.General, v) } func (o Parameters) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.General) { - toSerialize["general"] = o.General + if val, ok := getParametersGetGeneralAttributeTypeOk(o.General); ok { + toSerialize["General"] = val } return toSerialize, nil } diff --git a/services/serviceenablement/model_parameters_general.go b/services/serviceenablement/model_parameters_general.go index 1172c1611..cc60076cb 100644 --- a/services/serviceenablement/model_parameters_general.go +++ b/services/serviceenablement/model_parameters_general.go @@ -17,11 +17,73 @@ import ( // checks if the ParametersGeneral type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ParametersGeneral{} +/* + types and functions for organizationId +*/ + +// isNotNullableString +type ParametersGeneralGetOrganizationIdAttributeType = *string + +func getParametersGeneralGetOrganizationIdAttributeTypeOk(arg ParametersGeneralGetOrganizationIdAttributeType) (ret ParametersGeneralGetOrganizationIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setParametersGeneralGetOrganizationIdAttributeType(arg *ParametersGeneralGetOrganizationIdAttributeType, val ParametersGeneralGetOrganizationIdRetType) { + *arg = &val +} + +type ParametersGeneralGetOrganizationIdArgType = string +type ParametersGeneralGetOrganizationIdRetType = string + +/* + types and functions for projectName +*/ + +// isNotNullableString +type ParametersGeneralGetProjectNameAttributeType = *string + +func getParametersGeneralGetProjectNameAttributeTypeOk(arg ParametersGeneralGetProjectNameAttributeType) (ret ParametersGeneralGetProjectNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setParametersGeneralGetProjectNameAttributeType(arg *ParametersGeneralGetProjectNameAttributeType, val ParametersGeneralGetProjectNameRetType) { + *arg = &val +} + +type ParametersGeneralGetProjectNameArgType = string +type ParametersGeneralGetProjectNameRetType = string + +/* + types and functions for projectScope +*/ + +// isEnumRef +type ParametersGeneralGetProjectScopeAttributeType = *string +type ParametersGeneralGetProjectScopeArgType = string +type ParametersGeneralGetProjectScopeRetType = string + +func getParametersGeneralGetProjectScopeAttributeTypeOk(arg ParametersGeneralGetProjectScopeAttributeType) (ret ParametersGeneralGetProjectScopeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setParametersGeneralGetProjectScopeAttributeType(arg *ParametersGeneralGetProjectScopeAttributeType, val ParametersGeneralGetProjectScopeRetType) { + *arg = &val +} + // ParametersGeneral struct for ParametersGeneral type ParametersGeneral struct { - OrganizationId *string `json:"organizationId,omitempty"` - ProjectName *string `json:"projectName,omitempty"` - ProjectScope *string `json:"projectScope,omitempty"` + OrganizationId ParametersGeneralGetOrganizationIdAttributeType `json:"organizationId,omitempty"` + ProjectName ParametersGeneralGetProjectNameAttributeType `json:"projectName,omitempty"` + ProjectScope ParametersGeneralGetProjectScopeAttributeType `json:"projectScope,omitempty"` } // NewParametersGeneral instantiates a new ParametersGeneral object @@ -30,8 +92,6 @@ type ParametersGeneral struct { // will change when the set of required properties is changed func NewParametersGeneral() *ParametersGeneral { this := ParametersGeneral{} - var projectScope string = "PUBLIC" - this.ProjectScope = &projectScope return &this } @@ -46,111 +106,84 @@ func NewParametersGeneralWithDefaults() *ParametersGeneral { } // GetOrganizationId returns the OrganizationId field value if set, zero value otherwise. -func (o *ParametersGeneral) GetOrganizationId() *string { - if o == nil || IsNil(o.OrganizationId) { - var ret *string - return ret - } - return o.OrganizationId +func (o *ParametersGeneral) GetOrganizationId() (res ParametersGeneralGetOrganizationIdRetType) { + res, _ = o.GetOrganizationIdOk() + return } // GetOrganizationIdOk returns a tuple with the OrganizationId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ParametersGeneral) GetOrganizationIdOk() (*string, bool) { - if o == nil || IsNil(o.OrganizationId) { - return nil, false - } - return o.OrganizationId, true +func (o *ParametersGeneral) GetOrganizationIdOk() (ret ParametersGeneralGetOrganizationIdRetType, ok bool) { + return getParametersGeneralGetOrganizationIdAttributeTypeOk(o.OrganizationId) } // HasOrganizationId returns a boolean if a field has been set. func (o *ParametersGeneral) HasOrganizationId() bool { - if o != nil && !IsNil(o.OrganizationId) { - return true - } - - return false + _, ok := o.GetOrganizationIdOk() + return ok } // SetOrganizationId gets a reference to the given string and assigns it to the OrganizationId field. -func (o *ParametersGeneral) SetOrganizationId(v *string) { - o.OrganizationId = v +func (o *ParametersGeneral) SetOrganizationId(v ParametersGeneralGetOrganizationIdRetType) { + setParametersGeneralGetOrganizationIdAttributeType(&o.OrganizationId, v) } // GetProjectName returns the ProjectName field value if set, zero value otherwise. -func (o *ParametersGeneral) GetProjectName() *string { - if o == nil || IsNil(o.ProjectName) { - var ret *string - return ret - } - return o.ProjectName +func (o *ParametersGeneral) GetProjectName() (res ParametersGeneralGetProjectNameRetType) { + res, _ = o.GetProjectNameOk() + return } // GetProjectNameOk returns a tuple with the ProjectName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ParametersGeneral) GetProjectNameOk() (*string, bool) { - if o == nil || IsNil(o.ProjectName) { - return nil, false - } - return o.ProjectName, true +func (o *ParametersGeneral) GetProjectNameOk() (ret ParametersGeneralGetProjectNameRetType, ok bool) { + return getParametersGeneralGetProjectNameAttributeTypeOk(o.ProjectName) } // HasProjectName returns a boolean if a field has been set. func (o *ParametersGeneral) HasProjectName() bool { - if o != nil && !IsNil(o.ProjectName) { - return true - } - - return false + _, ok := o.GetProjectNameOk() + return ok } // SetProjectName gets a reference to the given string and assigns it to the ProjectName field. -func (o *ParametersGeneral) SetProjectName(v *string) { - o.ProjectName = v +func (o *ParametersGeneral) SetProjectName(v ParametersGeneralGetProjectNameRetType) { + setParametersGeneralGetProjectNameAttributeType(&o.ProjectName, v) } // GetProjectScope returns the ProjectScope field value if set, zero value otherwise. -func (o *ParametersGeneral) GetProjectScope() *string { - if o == nil || IsNil(o.ProjectScope) { - var ret *string - return ret - } - return o.ProjectScope +func (o *ParametersGeneral) GetProjectScope() (res ParametersGeneralGetProjectScopeRetType) { + res, _ = o.GetProjectScopeOk() + return } // GetProjectScopeOk returns a tuple with the ProjectScope field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ParametersGeneral) GetProjectScopeOk() (*string, bool) { - if o == nil || IsNil(o.ProjectScope) { - return nil, false - } - return o.ProjectScope, true +func (o *ParametersGeneral) GetProjectScopeOk() (ret ParametersGeneralGetProjectScopeRetType, ok bool) { + return getParametersGeneralGetProjectScopeAttributeTypeOk(o.ProjectScope) } // HasProjectScope returns a boolean if a field has been set. func (o *ParametersGeneral) HasProjectScope() bool { - if o != nil && !IsNil(o.ProjectScope) { - return true - } - - return false + _, ok := o.GetProjectScopeOk() + return ok } // SetProjectScope gets a reference to the given string and assigns it to the ProjectScope field. -func (o *ParametersGeneral) SetProjectScope(v *string) { - o.ProjectScope = v +func (o *ParametersGeneral) SetProjectScope(v ParametersGeneralGetProjectScopeRetType) { + setParametersGeneralGetProjectScopeAttributeType(&o.ProjectScope, v) } func (o ParametersGeneral) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.OrganizationId) { - toSerialize["organizationId"] = o.OrganizationId + if val, ok := getParametersGeneralGetOrganizationIdAttributeTypeOk(o.OrganizationId); ok { + toSerialize["OrganizationId"] = val } - if !IsNil(o.ProjectName) { - toSerialize["projectName"] = o.ProjectName + if val, ok := getParametersGeneralGetProjectNameAttributeTypeOk(o.ProjectName); ok { + toSerialize["ProjectName"] = val } - if !IsNil(o.ProjectScope) { - toSerialize["projectScope"] = o.ProjectScope + if val, ok := getParametersGeneralGetProjectScopeAttributeTypeOk(o.ProjectScope); ok { + toSerialize["ProjectScope"] = val } return toSerialize, nil } diff --git a/services/serviceenablement/model_service_status.go b/services/serviceenablement/model_service_status.go index 78a3ce5c0..2a7c8e9e5 100644 --- a/services/serviceenablement/model_service_status.go +++ b/services/serviceenablement/model_service_status.go @@ -17,19 +17,200 @@ import ( // checks if the ServiceStatus type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ServiceStatus{} +/* + types and functions for dependencies +*/ + +// isModel +type ServiceStatusGetDependenciesAttributeType = *Dependencies +type ServiceStatusGetDependenciesArgType = Dependencies +type ServiceStatusGetDependenciesRetType = Dependencies + +func getServiceStatusGetDependenciesAttributeTypeOk(arg ServiceStatusGetDependenciesAttributeType) (ret ServiceStatusGetDependenciesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceStatusGetDependenciesAttributeType(arg *ServiceStatusGetDependenciesAttributeType, val ServiceStatusGetDependenciesRetType) { + *arg = &val +} + +/* + types and functions for enablement +*/ + +// isEnumRef +type ServiceStatusGetEnablementAttributeType = *string +type ServiceStatusGetEnablementArgType = string +type ServiceStatusGetEnablementRetType = string + +func getServiceStatusGetEnablementAttributeTypeOk(arg ServiceStatusGetEnablementAttributeType) (ret ServiceStatusGetEnablementRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceStatusGetEnablementAttributeType(arg *ServiceStatusGetEnablementAttributeType, val ServiceStatusGetEnablementRetType) { + *arg = &val +} + +/* + types and functions for error +*/ + +// isModel +type ServiceStatusGetErrorAttributeType = *ActionError +type ServiceStatusGetErrorArgType = ActionError +type ServiceStatusGetErrorRetType = ActionError + +func getServiceStatusGetErrorAttributeTypeOk(arg ServiceStatusGetErrorAttributeType) (ret ServiceStatusGetErrorRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceStatusGetErrorAttributeType(arg *ServiceStatusGetErrorAttributeType, val ServiceStatusGetErrorRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isContainer +type ServiceStatusGetLabelsAttributeType = *map[string]string +type ServiceStatusGetLabelsArgType = map[string]string +type ServiceStatusGetLabelsRetType = map[string]string + +func getServiceStatusGetLabelsAttributeTypeOk(arg ServiceStatusGetLabelsAttributeType) (ret ServiceStatusGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceStatusGetLabelsAttributeType(arg *ServiceStatusGetLabelsAttributeType, val ServiceStatusGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for lifecycle +*/ + +// isEnumRef +type ServiceStatusGetLifecycleAttributeType = *string +type ServiceStatusGetLifecycleArgType = string +type ServiceStatusGetLifecycleRetType = string + +func getServiceStatusGetLifecycleAttributeTypeOk(arg ServiceStatusGetLifecycleAttributeType) (ret ServiceStatusGetLifecycleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceStatusGetLifecycleAttributeType(arg *ServiceStatusGetLifecycleAttributeType, val ServiceStatusGetLifecycleRetType) { + *arg = &val +} + +/* + types and functions for parameters +*/ + +// fallback +type ServiceStatusGetParametersAttributeType = *Parameters +type ServiceStatusGetParametersArgType = Parameters +type ServiceStatusGetParametersRetType = Parameters + +func getServiceStatusGetParametersAttributeTypeOk(arg ServiceStatusGetParametersAttributeType) (ret ServiceStatusGetParametersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceStatusGetParametersAttributeType(arg *ServiceStatusGetParametersAttributeType, val ServiceStatusGetParametersRetType) { + *arg = &val +} + +/* + types and functions for scope +*/ + +// isEnumRef +type ServiceStatusGetScopeAttributeType = *string +type ServiceStatusGetScopeArgType = string +type ServiceStatusGetScopeRetType = string + +func getServiceStatusGetScopeAttributeTypeOk(arg ServiceStatusGetScopeAttributeType) (ret ServiceStatusGetScopeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceStatusGetScopeAttributeType(arg *ServiceStatusGetScopeAttributeType, val ServiceStatusGetScopeRetType) { + *arg = &val +} + +/* + types and functions for serviceId +*/ + +// isNotNullableString +type ServiceStatusGetServiceIdAttributeType = *string + +func getServiceStatusGetServiceIdAttributeTypeOk(arg ServiceStatusGetServiceIdAttributeType) (ret ServiceStatusGetServiceIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceStatusGetServiceIdAttributeType(arg *ServiceStatusGetServiceIdAttributeType, val ServiceStatusGetServiceIdRetType) { + *arg = &val +} + +type ServiceStatusGetServiceIdArgType = string +type ServiceStatusGetServiceIdRetType = string + +/* + types and functions for state +*/ + +// isEnumRef +type ServiceStatusGetStateAttributeType = *string +type ServiceStatusGetStateArgType = string +type ServiceStatusGetStateRetType = string + +func getServiceStatusGetStateAttributeTypeOk(arg ServiceStatusGetStateAttributeType) (ret ServiceStatusGetStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServiceStatusGetStateAttributeType(arg *ServiceStatusGetStateAttributeType, val ServiceStatusGetStateRetType) { + *arg = &val +} + // ServiceStatus struct for ServiceStatus type ServiceStatus struct { - Dependencies *Dependencies `json:"dependencies,omitempty"` - Enablement *string `json:"enablement,omitempty"` - Error *ActionError `json:"error,omitempty"` - Labels *map[string]string `json:"labels,omitempty"` - Lifecycle *string `json:"lifecycle,omitempty"` - Parameters *Parameters `json:"parameters,omitempty"` - Scope *string `json:"scope,omitempty"` + Dependencies ServiceStatusGetDependenciesAttributeType `json:"dependencies,omitempty"` + Enablement ServiceStatusGetEnablementAttributeType `json:"enablement,omitempty"` + Error ServiceStatusGetErrorAttributeType `json:"error,omitempty"` + Labels ServiceStatusGetLabelsAttributeType `json:"labels,omitempty"` + Lifecycle ServiceStatusGetLifecycleAttributeType `json:"lifecycle,omitempty"` + Parameters ServiceStatusGetParametersAttributeType `json:"parameters,omitempty"` + Scope ServiceStatusGetScopeAttributeType `json:"scope,omitempty"` // the id of the service - ServiceId *string `json:"serviceId,omitempty"` + ServiceId ServiceStatusGetServiceIdAttributeType `json:"serviceId,omitempty"` // the state of a service within a project - State *string `json:"state,omitempty"` + State ServiceStatusGetStateAttributeType `json:"state,omitempty"` } // NewServiceStatus instantiates a new ServiceStatus object @@ -38,14 +219,6 @@ type ServiceStatus struct { // will change when the set of required properties is changed func NewServiceStatus() *ServiceStatus { this := ServiceStatus{} - var enablement string = "REQUEST" - this.Enablement = &enablement - var lifecycle string = "FLEX" - this.Lifecycle = &lifecycle - var scope string = "PUBLIC" - this.Scope = &scope - var state string = "ENABLED" - this.State = &state return &this } @@ -66,321 +239,240 @@ func NewServiceStatusWithDefaults() *ServiceStatus { } // GetDependencies returns the Dependencies field value if set, zero value otherwise. -func (o *ServiceStatus) GetDependencies() *Dependencies { - if o == nil || IsNil(o.Dependencies) { - var ret *Dependencies - return ret - } - return o.Dependencies +func (o *ServiceStatus) GetDependencies() (res ServiceStatusGetDependenciesRetType) { + res, _ = o.GetDependenciesOk() + return } // GetDependenciesOk returns a tuple with the Dependencies field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServiceStatus) GetDependenciesOk() (*Dependencies, bool) { - if o == nil || IsNil(o.Dependencies) { - return nil, false - } - return o.Dependencies, true +func (o *ServiceStatus) GetDependenciesOk() (ret ServiceStatusGetDependenciesRetType, ok bool) { + return getServiceStatusGetDependenciesAttributeTypeOk(o.Dependencies) } // HasDependencies returns a boolean if a field has been set. func (o *ServiceStatus) HasDependencies() bool { - if o != nil && !IsNil(o.Dependencies) { - return true - } - - return false + _, ok := o.GetDependenciesOk() + return ok } // SetDependencies gets a reference to the given Dependencies and assigns it to the Dependencies field. -func (o *ServiceStatus) SetDependencies(v *Dependencies) { - o.Dependencies = v +func (o *ServiceStatus) SetDependencies(v ServiceStatusGetDependenciesRetType) { + setServiceStatusGetDependenciesAttributeType(&o.Dependencies, v) } // GetEnablement returns the Enablement field value if set, zero value otherwise. -func (o *ServiceStatus) GetEnablement() *string { - if o == nil || IsNil(o.Enablement) { - var ret *string - return ret - } - return o.Enablement +func (o *ServiceStatus) GetEnablement() (res ServiceStatusGetEnablementRetType) { + res, _ = o.GetEnablementOk() + return } // GetEnablementOk returns a tuple with the Enablement field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServiceStatus) GetEnablementOk() (*string, bool) { - if o == nil || IsNil(o.Enablement) { - return nil, false - } - return o.Enablement, true +func (o *ServiceStatus) GetEnablementOk() (ret ServiceStatusGetEnablementRetType, ok bool) { + return getServiceStatusGetEnablementAttributeTypeOk(o.Enablement) } // HasEnablement returns a boolean if a field has been set. func (o *ServiceStatus) HasEnablement() bool { - if o != nil && !IsNil(o.Enablement) { - return true - } - - return false + _, ok := o.GetEnablementOk() + return ok } // SetEnablement gets a reference to the given string and assigns it to the Enablement field. -func (o *ServiceStatus) SetEnablement(v *string) { - o.Enablement = v +func (o *ServiceStatus) SetEnablement(v ServiceStatusGetEnablementRetType) { + setServiceStatusGetEnablementAttributeType(&o.Enablement, v) } // GetError returns the Error field value if set, zero value otherwise. -func (o *ServiceStatus) GetError() *ActionError { - if o == nil || IsNil(o.Error) { - var ret *ActionError - return ret - } - return o.Error +func (o *ServiceStatus) GetError() (res ServiceStatusGetErrorRetType) { + 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 *ServiceStatus) GetErrorOk() (*ActionError, bool) { - if o == nil || IsNil(o.Error) { - return nil, false - } - return o.Error, true +func (o *ServiceStatus) GetErrorOk() (ret ServiceStatusGetErrorRetType, ok bool) { + return getServiceStatusGetErrorAttributeTypeOk(o.Error) } // HasError returns a boolean if a field has been set. func (o *ServiceStatus) HasError() bool { - if o != nil && !IsNil(o.Error) { - return true - } - - return false + _, ok := o.GetErrorOk() + return ok } // SetError gets a reference to the given ActionError and assigns it to the Error field. -func (o *ServiceStatus) SetError(v *ActionError) { - o.Error = v +func (o *ServiceStatus) SetError(v ServiceStatusGetErrorRetType) { + setServiceStatusGetErrorAttributeType(&o.Error, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *ServiceStatus) GetLabels() *map[string]string { - if o == nil || IsNil(o.Labels) { - var ret *map[string]string - return ret - } - return o.Labels +func (o *ServiceStatus) GetLabels() (res ServiceStatusGetLabelsRetType) { + 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 *ServiceStatus) GetLabelsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Labels) { - return nil, false - } - return o.Labels, true +func (o *ServiceStatus) GetLabelsOk() (ret ServiceStatusGetLabelsRetType, ok bool) { + return getServiceStatusGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *ServiceStatus) 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 *ServiceStatus) SetLabels(v *map[string]string) { - o.Labels = v +func (o *ServiceStatus) SetLabels(v ServiceStatusGetLabelsRetType) { + setServiceStatusGetLabelsAttributeType(&o.Labels, v) } // GetLifecycle returns the Lifecycle field value if set, zero value otherwise. -func (o *ServiceStatus) GetLifecycle() *string { - if o == nil || IsNil(o.Lifecycle) { - var ret *string - return ret - } - return o.Lifecycle +func (o *ServiceStatus) GetLifecycle() (res ServiceStatusGetLifecycleRetType) { + res, _ = o.GetLifecycleOk() + return } // GetLifecycleOk returns a tuple with the Lifecycle field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServiceStatus) GetLifecycleOk() (*string, bool) { - if o == nil || IsNil(o.Lifecycle) { - return nil, false - } - return o.Lifecycle, true +func (o *ServiceStatus) GetLifecycleOk() (ret ServiceStatusGetLifecycleRetType, ok bool) { + return getServiceStatusGetLifecycleAttributeTypeOk(o.Lifecycle) } // HasLifecycle returns a boolean if a field has been set. func (o *ServiceStatus) HasLifecycle() bool { - if o != nil && !IsNil(o.Lifecycle) { - return true - } - - return false + _, ok := o.GetLifecycleOk() + return ok } // SetLifecycle gets a reference to the given string and assigns it to the Lifecycle field. -func (o *ServiceStatus) SetLifecycle(v *string) { - o.Lifecycle = v +func (o *ServiceStatus) SetLifecycle(v ServiceStatusGetLifecycleRetType) { + setServiceStatusGetLifecycleAttributeType(&o.Lifecycle, v) } // GetParameters returns the Parameters field value if set, zero value otherwise. -func (o *ServiceStatus) GetParameters() *Parameters { - if o == nil || IsNil(o.Parameters) { - var ret *Parameters - return ret - } - return o.Parameters +func (o *ServiceStatus) GetParameters() (res ServiceStatusGetParametersRetType) { + res, _ = o.GetParametersOk() + return } // GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServiceStatus) GetParametersOk() (*Parameters, bool) { - if o == nil || IsNil(o.Parameters) { - return nil, false - } - return o.Parameters, true +func (o *ServiceStatus) GetParametersOk() (ret ServiceStatusGetParametersRetType, ok bool) { + return getServiceStatusGetParametersAttributeTypeOk(o.Parameters) } // HasParameters returns a boolean if a field has been set. func (o *ServiceStatus) HasParameters() bool { - if o != nil && !IsNil(o.Parameters) { - return true - } - - return false + _, ok := o.GetParametersOk() + return ok } // SetParameters gets a reference to the given Parameters and assigns it to the Parameters field. -func (o *ServiceStatus) SetParameters(v *Parameters) { - o.Parameters = v +func (o *ServiceStatus) SetParameters(v ServiceStatusGetParametersRetType) { + setServiceStatusGetParametersAttributeType(&o.Parameters, v) } // GetScope returns the Scope field value if set, zero value otherwise. -func (o *ServiceStatus) GetScope() *string { - if o == nil || IsNil(o.Scope) { - var ret *string - return ret - } - return o.Scope +func (o *ServiceStatus) GetScope() (res ServiceStatusGetScopeRetType) { + res, _ = o.GetScopeOk() + return } // GetScopeOk returns a tuple with the Scope field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServiceStatus) GetScopeOk() (*string, bool) { - if o == nil || IsNil(o.Scope) { - return nil, false - } - return o.Scope, true +func (o *ServiceStatus) GetScopeOk() (ret ServiceStatusGetScopeRetType, ok bool) { + return getServiceStatusGetScopeAttributeTypeOk(o.Scope) } // HasScope returns a boolean if a field has been set. func (o *ServiceStatus) HasScope() bool { - if o != nil && !IsNil(o.Scope) { - return true - } - - return false + _, ok := o.GetScopeOk() + return ok } // SetScope gets a reference to the given string and assigns it to the Scope field. -func (o *ServiceStatus) SetScope(v *string) { - o.Scope = v +func (o *ServiceStatus) SetScope(v ServiceStatusGetScopeRetType) { + setServiceStatusGetScopeAttributeType(&o.Scope, v) } // GetServiceId returns the ServiceId field value if set, zero value otherwise. -func (o *ServiceStatus) GetServiceId() *string { - if o == nil || IsNil(o.ServiceId) { - var ret *string - return ret - } - return o.ServiceId +func (o *ServiceStatus) GetServiceId() (res ServiceStatusGetServiceIdRetType) { + res, _ = o.GetServiceIdOk() + return } // GetServiceIdOk returns a tuple with the ServiceId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ServiceStatus) GetServiceIdOk() (*string, bool) { - if o == nil || IsNil(o.ServiceId) { - return nil, false - } - return o.ServiceId, true +func (o *ServiceStatus) GetServiceIdOk() (ret ServiceStatusGetServiceIdRetType, ok bool) { + return getServiceStatusGetServiceIdAttributeTypeOk(o.ServiceId) } // HasServiceId returns a boolean if a field has been set. func (o *ServiceStatus) HasServiceId() bool { - if o != nil && !IsNil(o.ServiceId) { - return true - } - - return false + _, ok := o.GetServiceIdOk() + return ok } // SetServiceId gets a reference to the given string and assigns it to the ServiceId field. -func (o *ServiceStatus) SetServiceId(v *string) { - o.ServiceId = v +func (o *ServiceStatus) SetServiceId(v ServiceStatusGetServiceIdRetType) { + setServiceStatusGetServiceIdAttributeType(&o.ServiceId, v) } // GetState returns the State field value if set, zero value otherwise. -func (o *ServiceStatus) GetState() *string { - if o == nil || IsNil(o.State) { - var ret *string - return ret - } - return o.State +func (o *ServiceStatus) GetState() (res ServiceStatusGetStateRetType) { + 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 *ServiceStatus) GetStateOk() (*string, bool) { - if o == nil || IsNil(o.State) { - return nil, false - } - return o.State, true +func (o *ServiceStatus) GetStateOk() (ret ServiceStatusGetStateRetType, ok bool) { + return getServiceStatusGetStateAttributeTypeOk(o.State) } // HasState returns a boolean if a field has been set. func (o *ServiceStatus) 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 *ServiceStatus) SetState(v *string) { - o.State = v +func (o *ServiceStatus) SetState(v ServiceStatusGetStateRetType) { + setServiceStatusGetStateAttributeType(&o.State, v) } func (o ServiceStatus) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Dependencies) { - toSerialize["dependencies"] = o.Dependencies + if val, ok := getServiceStatusGetDependenciesAttributeTypeOk(o.Dependencies); ok { + toSerialize["Dependencies"] = val } - if !IsNil(o.Enablement) { - toSerialize["enablement"] = o.Enablement + if val, ok := getServiceStatusGetEnablementAttributeTypeOk(o.Enablement); ok { + toSerialize["Enablement"] = val } - if !IsNil(o.Error) { - toSerialize["error"] = o.Error + if val, ok := getServiceStatusGetErrorAttributeTypeOk(o.Error); ok { + toSerialize["Error"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getServiceStatusGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Lifecycle) { - toSerialize["lifecycle"] = o.Lifecycle + if val, ok := getServiceStatusGetLifecycleAttributeTypeOk(o.Lifecycle); ok { + toSerialize["Lifecycle"] = val } - if !IsNil(o.Parameters) { - toSerialize["parameters"] = o.Parameters + if val, ok := getServiceStatusGetParametersAttributeTypeOk(o.Parameters); ok { + toSerialize["Parameters"] = val } - if !IsNil(o.Scope) { - toSerialize["scope"] = o.Scope + if val, ok := getServiceStatusGetScopeAttributeTypeOk(o.Scope); ok { + toSerialize["Scope"] = val } - if !IsNil(o.ServiceId) { - toSerialize["serviceId"] = o.ServiceId + if val, ok := getServiceStatusGetServiceIdAttributeTypeOk(o.ServiceId); ok { + toSerialize["ServiceId"] = val } - if !IsNil(o.State) { - toSerialize["state"] = o.State + if val, ok := getServiceStatusGetStateAttributeTypeOk(o.State); ok { + toSerialize["State"] = val } return toSerialize, nil } diff --git a/services/serviceenablement/utils.go b/services/serviceenablement/utils.go index c4b307bcc..5ba2ba85c 100644 --- a/services/serviceenablement/utils.go +++ b/services/serviceenablement/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()