diff --git a/services/resourcemanager/api_default_test.go b/services/resourcemanager/api_default_test.go index 108e289dd..6a5257794 100644 --- a/services/resourcemanager/api_default_test.go +++ b/services/resourcemanager/api_default_test.go @@ -24,10 +24,10 @@ import ( func Test_resourcemanager_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService CreateProject", func(t *testing.T) { - path := "/v2/projects" + _apiUrlPath := "/v2/projects" testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := Project{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -66,18 +66,18 @@ func Test_resourcemanager_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 DeleteProject", func(t *testing.T) { - path := "/v2/projects/{id}" + _apiUrlPath := "/v2/projects/{id}" idValue := "id" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -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() @@ -108,7 +108,7 @@ func Test_resourcemanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - id := "id" + id := idValue reqErr := apiClient.DeleteProject(context.Background(), id).Execute() @@ -118,12 +118,12 @@ func Test_resourcemanager_DefaultApiService(t *testing.T) { }) t.Run("Test DefaultApiService GetOrganization", func(t *testing.T) { - path := "/v2/organizations/{id}" + _apiUrlPath := "/v2/organizations/{id}" idValue := "id" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -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 := OrganizationResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -157,25 +157,25 @@ func Test_resourcemanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - id := "id" + id := idValue resp, reqErr := apiClient.GetOrganization(context.Background(), id).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 GetProject", func(t *testing.T) { - path := "/v2/projects/{id}" + _apiUrlPath := "/v2/projects/{id}" idValue := "id" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -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 := GetProjectResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -209,23 +209,23 @@ func Test_resourcemanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - id := "id" + id := idValue resp, reqErr := apiClient.GetProject(context.Background(), id).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 ListOrganizations", func(t *testing.T) { - path := "/v2/organizations" + _apiUrlPath := "/v2/organizations" testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := ListOrganizationsResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -264,16 +264,16 @@ func Test_resourcemanager_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 ListProjects", func(t *testing.T) { - path := "/v2/projects" + _apiUrlPath := "/v2/projects" testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := ListProjectsResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -312,18 +312,18 @@ func Test_resourcemanager_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 PartialUpdateProject", func(t *testing.T) { - path := "/v2/projects/{id}" + _apiUrlPath := "/v2/projects/{id}" idValue := "id" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -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 := Project{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -357,14 +357,14 @@ func Test_resourcemanager_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - id := "id" + id := idValue resp, reqErr := apiClient.PartialUpdateProject(context.Background(), id).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/resourcemanager/model_create_project_payload.go b/services/resourcemanager/model_create_project_payload.go index 28d859ea0..2e3b9e00c 100644 --- a/services/resourcemanager/model_create_project_payload.go +++ b/services/resourcemanager/model_create_project_payload.go @@ -17,19 +17,101 @@ import ( // checks if the CreateProjectPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateProjectPayload{} +/* + types and functions for containerParentId +*/ + +// isNotNullableString +type CreateProjectPayloadGetContainerParentIdAttributeType = *string + +func getCreateProjectPayloadGetContainerParentIdAttributeTypeOk(arg CreateProjectPayloadGetContainerParentIdAttributeType) (ret CreateProjectPayloadGetContainerParentIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateProjectPayloadGetContainerParentIdAttributeType(arg *CreateProjectPayloadGetContainerParentIdAttributeType, val CreateProjectPayloadGetContainerParentIdRetType) { + *arg = &val +} + +type CreateProjectPayloadGetContainerParentIdArgType = string +type CreateProjectPayloadGetContainerParentIdRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type CreateProjectPayloadGetLabelsAttributeType = *map[string]string +type CreateProjectPayloadGetLabelsArgType = map[string]string +type CreateProjectPayloadGetLabelsRetType = map[string]string + +func getCreateProjectPayloadGetLabelsAttributeTypeOk(arg CreateProjectPayloadGetLabelsAttributeType) (ret CreateProjectPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateProjectPayloadGetLabelsAttributeType(arg *CreateProjectPayloadGetLabelsAttributeType, val CreateProjectPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for members +*/ + +// isArray +type CreateProjectPayloadGetMembersAttributeType = *[]Member +type CreateProjectPayloadGetMembersArgType = []Member +type CreateProjectPayloadGetMembersRetType = []Member + +func getCreateProjectPayloadGetMembersAttributeTypeOk(arg CreateProjectPayloadGetMembersAttributeType) (ret CreateProjectPayloadGetMembersRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateProjectPayloadGetMembersAttributeType(arg *CreateProjectPayloadGetMembersAttributeType, val CreateProjectPayloadGetMembersRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type CreateProjectPayloadGetNameAttributeType = *string + +func getCreateProjectPayloadGetNameAttributeTypeOk(arg CreateProjectPayloadGetNameAttributeType) (ret CreateProjectPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateProjectPayloadGetNameAttributeType(arg *CreateProjectPayloadGetNameAttributeType, val CreateProjectPayloadGetNameRetType) { + *arg = &val +} + +type CreateProjectPayloadGetNameArgType = string +type CreateProjectPayloadGetNameRetType = string + // CreateProjectPayload struct for CreateProjectPayload type CreateProjectPayload struct { // Identifier of the parent resource container - containerId as well as UUID identifier is supported. // REQUIRED - ContainerParentId *string `json:"containerParentId"` + ContainerParentId CreateProjectPayloadGetContainerParentIdAttributeType `json:"containerParentId"` // Labels are key-value string pairs that can be attached to a resource container. Some labels may be enforced via policies. - A label key must match the regex `[A-ZÄÜÖa-zäüöß0-9_-]{1,64}`. - A label value must match the regex `^$|[A-ZÄÜÖa-zäüöß0-9_-]{1,64}`. - Labels *map[string]string `json:"labels,omitempty"` + Labels CreateProjectPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The initial members assigned to the project. At least one subject needs to be a user, and not a client or service account. // REQUIRED - Members *[]Member `json:"members"` + Members CreateProjectPayloadGetMembersAttributeType `json:"members"` // Project name matching the regex `^[a-zA-ZäüöÄÜÖ0-9]( ?[a-zA-ZäüöÄÜÖß0-9_+&-]){0,39}$`. // REQUIRED - Name *string `json:"name"` + Name CreateProjectPayloadGetNameAttributeType `json:"name"` } type _CreateProjectPayload CreateProjectPayload @@ -38,11 +120,11 @@ type _CreateProjectPayload CreateProjectPayload // 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 NewCreateProjectPayload(containerParentId *string, members *[]Member, name *string) *CreateProjectPayload { +func NewCreateProjectPayload(containerParentId CreateProjectPayloadGetContainerParentIdArgType, members CreateProjectPayloadGetMembersArgType, name CreateProjectPayloadGetNameArgType) *CreateProjectPayload { this := CreateProjectPayload{} - this.ContainerParentId = containerParentId - this.Members = members - this.Name = name + setCreateProjectPayloadGetContainerParentIdAttributeType(&this.ContainerParentId, containerParentId) + setCreateProjectPayloadGetMembersAttributeType(&this.Members, members) + setCreateProjectPayloadGetNameAttributeType(&this.Name, name) return &this } @@ -55,117 +137,93 @@ func NewCreateProjectPayloadWithDefaults() *CreateProjectPayload { } // GetContainerParentId returns the ContainerParentId field value -func (o *CreateProjectPayload) GetContainerParentId() *string { - if o == nil || IsNil(o.ContainerParentId) { - var ret *string - return ret - } - - return o.ContainerParentId +func (o *CreateProjectPayload) GetContainerParentId() (ret CreateProjectPayloadGetContainerParentIdRetType) { + ret, _ = o.GetContainerParentIdOk() + return ret } // GetContainerParentIdOk returns a tuple with the ContainerParentId field value // and a boolean to check if the value has been set. -func (o *CreateProjectPayload) GetContainerParentIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ContainerParentId, true +func (o *CreateProjectPayload) GetContainerParentIdOk() (ret CreateProjectPayloadGetContainerParentIdRetType, ok bool) { + return getCreateProjectPayloadGetContainerParentIdAttributeTypeOk(o.ContainerParentId) } // SetContainerParentId sets field value -func (o *CreateProjectPayload) SetContainerParentId(v *string) { - o.ContainerParentId = v +func (o *CreateProjectPayload) SetContainerParentId(v CreateProjectPayloadGetContainerParentIdRetType) { + setCreateProjectPayloadGetContainerParentIdAttributeType(&o.ContainerParentId, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateProjectPayload) GetLabels() *map[string]string { - if o == nil || IsNil(o.Labels) { - var ret *map[string]string - return ret - } - return o.Labels +func (o *CreateProjectPayload) GetLabels() (res CreateProjectPayloadGetLabelsRetType) { + 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 *CreateProjectPayload) GetLabelsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Labels) { - return nil, false - } - return o.Labels, true +func (o *CreateProjectPayload) GetLabelsOk() (ret CreateProjectPayloadGetLabelsRetType, ok bool) { + return getCreateProjectPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *CreateProjectPayload) 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 *CreateProjectPayload) SetLabels(v *map[string]string) { - o.Labels = v +func (o *CreateProjectPayload) SetLabels(v CreateProjectPayloadGetLabelsRetType) { + setCreateProjectPayloadGetLabelsAttributeType(&o.Labels, v) } // GetMembers returns the Members field value -func (o *CreateProjectPayload) GetMembers() *[]Member { - if o == nil || IsNil(o.Members) { - var ret *[]Member - return ret - } - - return o.Members +func (o *CreateProjectPayload) GetMembers() (ret CreateProjectPayloadGetMembersRetType) { + ret, _ = o.GetMembersOk() + return ret } // GetMembersOk returns a tuple with the Members field value // and a boolean to check if the value has been set. -func (o *CreateProjectPayload) GetMembersOk() (*[]Member, bool) { - if o == nil { - return nil, false - } - return o.Members, true +func (o *CreateProjectPayload) GetMembersOk() (ret CreateProjectPayloadGetMembersRetType, ok bool) { + return getCreateProjectPayloadGetMembersAttributeTypeOk(o.Members) } // SetMembers sets field value -func (o *CreateProjectPayload) SetMembers(v *[]Member) { - o.Members = v +func (o *CreateProjectPayload) SetMembers(v CreateProjectPayloadGetMembersRetType) { + setCreateProjectPayloadGetMembersAttributeType(&o.Members, v) } // GetName returns the Name field value -func (o *CreateProjectPayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *CreateProjectPayload) GetName() (ret CreateProjectPayloadGetNameRetType) { + 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 *CreateProjectPayload) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *CreateProjectPayload) GetNameOk() (ret CreateProjectPayloadGetNameRetType, ok bool) { + return getCreateProjectPayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *CreateProjectPayload) SetName(v *string) { - o.Name = v +func (o *CreateProjectPayload) SetName(v CreateProjectPayloadGetNameRetType) { + setCreateProjectPayloadGetNameAttributeType(&o.Name, v) } func (o CreateProjectPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["containerParentId"] = o.ContainerParentId - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getCreateProjectPayloadGetContainerParentIdAttributeTypeOk(o.ContainerParentId); ok { + toSerialize["ContainerParentId"] = val + } + if val, ok := getCreateProjectPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getCreateProjectPayloadGetMembersAttributeTypeOk(o.Members); ok { + toSerialize["Members"] = val + } + if val, ok := getCreateProjectPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - toSerialize["members"] = o.Members - toSerialize["name"] = o.Name return toSerialize, nil } diff --git a/services/resourcemanager/model_error_response.go b/services/resourcemanager/model_error_response.go index a1f75abb3..ffc7c10fc 100644 --- a/services/resourcemanager/model_error_response.go +++ b/services/resourcemanager/model_error_response.go @@ -18,23 +18,126 @@ 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 +*/ + +// isNumber +type ErrorResponseGetStatusAttributeType = *float64 +type ErrorResponseGetStatusArgType = float64 +type ErrorResponseGetStatusRetType = float64 + +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 { // The reason phrase of the status code. // REQUIRED - Error *string `json:"error"` + Error ErrorResponseGetErrorAttributeType `json:"error"` // Description of the error. // REQUIRED - Message *string `json:"message"` + Message ErrorResponseGetMessageAttributeType `json:"message"` // Path which was called. // REQUIRED - Path *string `json:"path"` + Path ErrorResponseGetPathAttributeType `json:"path"` // Http Status Code. // REQUIRED - Status *float64 `json:"status"` + Status ErrorResponseGetStatusAttributeType `json:"status"` // Timestamp at which the error occurred. // REQUIRED - TimeStamp *time.Time `json:"timeStamp"` + TimeStamp ErrorResponseGetTimeStampAttributeType `json:"timeStamp"` } type _ErrorResponse ErrorResponse @@ -43,13 +146,13 @@ type _ErrorResponse ErrorResponse // 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 NewErrorResponse(error_ *string, message *string, path *string, status *float64, timeStamp *time.Time) *ErrorResponse { +func NewErrorResponse(error_ ErrorResponseGetErrorArgType, message ErrorResponseGetMessageArgType, path ErrorResponseGetPathArgType, status ErrorResponseGetStatusArgType, timeStamp ErrorResponseGetTimeStampArgType) *ErrorResponse { this := ErrorResponse{} - this.Error = error_ - this.Message = message - this.Path = path - this.Status = status - this.TimeStamp = timeStamp + setErrorResponseGetErrorAttributeType(&this.Error, error_) + setErrorResponseGetMessageAttributeType(&this.Message, message) + setErrorResponseGetPathAttributeType(&this.Path, path) + setErrorResponseGetStatusAttributeType(&this.Status, status) + setErrorResponseGetTimeStampAttributeType(&this.TimeStamp, timeStamp) return &this } @@ -62,132 +165,107 @@ func NewErrorResponseWithDefaults() *ErrorResponse { } // GetError returns the Error field value -func (o *ErrorResponse) GetError() *string { - if o == nil || IsNil(o.Error) { - var ret *string - return ret - } - - return o.Error +func (o *ErrorResponse) GetError() (ret ErrorResponseGetErrorRetType) { + ret, _ = o.GetErrorOk() + return ret } // GetErrorOk returns a tuple with the Error field value // and a boolean to check if the value has been set. -func (o *ErrorResponse) GetErrorOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Error, true +func (o *ErrorResponse) GetErrorOk() (ret ErrorResponseGetErrorRetType, ok bool) { + return getErrorResponseGetErrorAttributeTypeOk(o.Error) } // SetError sets field value -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 -func (o *ErrorResponse) GetMessage() *string { - if o == nil || IsNil(o.Message) { - var ret *string - return ret - } - - return o.Message +func (o *ErrorResponse) GetMessage() (ret ErrorResponseGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret } // GetMessageOk returns a tuple with the Message field value // and a boolean to check if the value has been set. -func (o *ErrorResponse) GetMessageOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Message, true +func (o *ErrorResponse) GetMessageOk() (ret ErrorResponseGetMessageRetType, ok bool) { + return getErrorResponseGetMessageAttributeTypeOk(o.Message) } // SetMessage sets field value -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 -func (o *ErrorResponse) GetPath() *string { - if o == nil || IsNil(o.Path) { - var ret *string - return ret - } - - return o.Path +func (o *ErrorResponse) GetPath() (ret ErrorResponseGetPathRetType) { + ret, _ = o.GetPathOk() + return ret } // GetPathOk returns a tuple with the Path field value // and a boolean to check if the value has been set. -func (o *ErrorResponse) GetPathOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Path, true +func (o *ErrorResponse) GetPathOk() (ret ErrorResponseGetPathRetType, ok bool) { + return getErrorResponseGetPathAttributeTypeOk(o.Path) } // SetPath sets field value -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 -func (o *ErrorResponse) GetStatus() *float64 { - if o == nil || IsNil(o.Status) { - var ret *float64 - return ret - } - - return o.Status +func (o *ErrorResponse) GetStatus() (ret ErrorResponseGetStatusRetType) { + ret, _ = o.GetStatusOk() + return ret } // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. -func (o *ErrorResponse) GetStatusOk() (*float64, bool) { - if o == nil { - return nil, false - } - return o.Status, true +func (o *ErrorResponse) GetStatusOk() (ret ErrorResponseGetStatusRetType, ok bool) { + return getErrorResponseGetStatusAttributeTypeOk(o.Status) } // SetStatus sets field value -func (o *ErrorResponse) SetStatus(v *float64) { - o.Status = v +func (o *ErrorResponse) SetStatus(v ErrorResponseGetStatusRetType) { + setErrorResponseGetStatusAttributeType(&o.Status, v) } // GetTimeStamp returns the TimeStamp field value -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() (ret ErrorResponseGetTimeStampRetType) { + ret, _ = o.GetTimeStampOk() + return ret } // GetTimeStampOk returns a tuple with the TimeStamp field value // and a boolean to check if the value has been set. -func (o *ErrorResponse) GetTimeStampOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.TimeStamp, true +func (o *ErrorResponse) GetTimeStampOk() (ret ErrorResponseGetTimeStampRetType, ok bool) { + return getErrorResponseGetTimeStampAttributeTypeOk(o.TimeStamp) } // SetTimeStamp sets field value -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{}{} - toSerialize["error"] = o.Error - toSerialize["message"] = o.Message - toSerialize["path"] = o.Path - toSerialize["status"] = o.Status - toSerialize["timeStamp"] = o.TimeStamp + if val, ok := getErrorResponseGetErrorAttributeTypeOk(o.Error); ok { + toSerialize["Error"] = val + } + if val, ok := getErrorResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + if val, ok := getErrorResponseGetPathAttributeTypeOk(o.Path); ok { + toSerialize["Path"] = val + } + if val, ok := getErrorResponseGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val + } + if val, ok := getErrorResponseGetTimeStampAttributeTypeOk(o.TimeStamp); ok { + toSerialize["TimeStamp"] = val + } return toSerialize, nil } diff --git a/services/resourcemanager/model_get_project_response.go b/services/resourcemanager/model_get_project_response.go index 319f555b1..5f9044f3f 100644 --- a/services/resourcemanager/model_get_project_response.go +++ b/services/resourcemanager/model_get_project_response.go @@ -18,30 +18,213 @@ import ( // checks if the GetProjectResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetProjectResponse{} +/* + types and functions for containerId +*/ + +// isNotNullableString +type GetProjectResponseGetContainerIdAttributeType = *string + +func getGetProjectResponseGetContainerIdAttributeTypeOk(arg GetProjectResponseGetContainerIdAttributeType) (ret GetProjectResponseGetContainerIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetProjectResponseGetContainerIdAttributeType(arg *GetProjectResponseGetContainerIdAttributeType, val GetProjectResponseGetContainerIdRetType) { + *arg = &val +} + +type GetProjectResponseGetContainerIdArgType = string +type GetProjectResponseGetContainerIdRetType = string + +/* + types and functions for creationTime +*/ + +// isDateTime +type GetProjectResponseGetCreationTimeAttributeType = *time.Time +type GetProjectResponseGetCreationTimeArgType = time.Time +type GetProjectResponseGetCreationTimeRetType = time.Time + +func getGetProjectResponseGetCreationTimeAttributeTypeOk(arg GetProjectResponseGetCreationTimeAttributeType) (ret GetProjectResponseGetCreationTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetProjectResponseGetCreationTimeAttributeType(arg *GetProjectResponseGetCreationTimeAttributeType, val GetProjectResponseGetCreationTimeRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isContainer +type GetProjectResponseGetLabelsAttributeType = *map[string]string +type GetProjectResponseGetLabelsArgType = map[string]string +type GetProjectResponseGetLabelsRetType = map[string]string + +func getGetProjectResponseGetLabelsAttributeTypeOk(arg GetProjectResponseGetLabelsAttributeType) (ret GetProjectResponseGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetProjectResponseGetLabelsAttributeType(arg *GetProjectResponseGetLabelsAttributeType, val GetProjectResponseGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for lifecycleState +*/ + +// isEnumRef +type GetProjectResponseGetLifecycleStateAttributeType = *LifecycleState +type GetProjectResponseGetLifecycleStateArgType = LifecycleState +type GetProjectResponseGetLifecycleStateRetType = LifecycleState + +func getGetProjectResponseGetLifecycleStateAttributeTypeOk(arg GetProjectResponseGetLifecycleStateAttributeType) (ret GetProjectResponseGetLifecycleStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetProjectResponseGetLifecycleStateAttributeType(arg *GetProjectResponseGetLifecycleStateAttributeType, val GetProjectResponseGetLifecycleStateRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type GetProjectResponseGetNameAttributeType = *string + +func getGetProjectResponseGetNameAttributeTypeOk(arg GetProjectResponseGetNameAttributeType) (ret GetProjectResponseGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetProjectResponseGetNameAttributeType(arg *GetProjectResponseGetNameAttributeType, val GetProjectResponseGetNameRetType) { + *arg = &val +} + +type GetProjectResponseGetNameArgType = string +type GetProjectResponseGetNameRetType = string + +/* + types and functions for parent +*/ + +// isModel +type GetProjectResponseGetParentAttributeType = *Parent +type GetProjectResponseGetParentArgType = Parent +type GetProjectResponseGetParentRetType = Parent + +func getGetProjectResponseGetParentAttributeTypeOk(arg GetProjectResponseGetParentAttributeType) (ret GetProjectResponseGetParentRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetProjectResponseGetParentAttributeType(arg *GetProjectResponseGetParentAttributeType, val GetProjectResponseGetParentRetType) { + *arg = &val +} + +/* + types and functions for parents +*/ + +// isArray +type GetProjectResponseGetParentsAttributeType = *[]ParentListInner +type GetProjectResponseGetParentsArgType = []ParentListInner +type GetProjectResponseGetParentsRetType = []ParentListInner + +func getGetProjectResponseGetParentsAttributeTypeOk(arg GetProjectResponseGetParentsAttributeType) (ret GetProjectResponseGetParentsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetProjectResponseGetParentsAttributeType(arg *GetProjectResponseGetParentsAttributeType, val GetProjectResponseGetParentsRetType) { + *arg = &val +} + +/* + types and functions for projectId +*/ + +// isNotNullableString +type GetProjectResponseGetProjectIdAttributeType = *string + +func getGetProjectResponseGetProjectIdAttributeTypeOk(arg GetProjectResponseGetProjectIdAttributeType) (ret GetProjectResponseGetProjectIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetProjectResponseGetProjectIdAttributeType(arg *GetProjectResponseGetProjectIdAttributeType, val GetProjectResponseGetProjectIdRetType) { + *arg = &val +} + +type GetProjectResponseGetProjectIdArgType = string +type GetProjectResponseGetProjectIdRetType = string + +/* + types and functions for updateTime +*/ + +// isDateTime +type GetProjectResponseGetUpdateTimeAttributeType = *time.Time +type GetProjectResponseGetUpdateTimeArgType = time.Time +type GetProjectResponseGetUpdateTimeRetType = time.Time + +func getGetProjectResponseGetUpdateTimeAttributeTypeOk(arg GetProjectResponseGetUpdateTimeAttributeType) (ret GetProjectResponseGetUpdateTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetProjectResponseGetUpdateTimeAttributeType(arg *GetProjectResponseGetUpdateTimeAttributeType, val GetProjectResponseGetUpdateTimeRetType) { + *arg = &val +} + // GetProjectResponse struct for GetProjectResponse type GetProjectResponse struct { // Globally unique identifier. // REQUIRED - ContainerId *string `json:"containerId"` + ContainerId GetProjectResponseGetContainerIdAttributeType `json:"containerId"` // Timestamp at which the project was created. // REQUIRED - CreationTime *time.Time `json:"creationTime"` + CreationTime GetProjectResponseGetCreationTimeAttributeType `json:"creationTime"` // Labels are key-value string pairs that can be attached to a resource container. Some labels may be enforced via policies. - A label key must match the regex `[A-ZÄÜÖa-zäüöß0-9_-]{1,64}`. - A label value must match the regex `^$|[A-ZÄÜÖa-zäüöß0-9_-]{1,64}`. - Labels *map[string]string `json:"labels,omitempty"` + Labels GetProjectResponseGetLabelsAttributeType `json:"labels,omitempty"` // REQUIRED - LifecycleState *LifecycleState `json:"lifecycleState"` + LifecycleState GetProjectResponseGetLifecycleStateAttributeType `json:"lifecycleState"` // Project name. // REQUIRED - Name *string `json:"name"` + Name GetProjectResponseGetNameAttributeType `json:"name"` // REQUIRED - Parent *Parent `json:"parent"` - Parents *[]ParentListInner `json:"parents,omitempty"` + Parent GetProjectResponseGetParentAttributeType `json:"parent"` + Parents GetProjectResponseGetParentsAttributeType `json:"parents,omitempty"` // Globally unique identifier. // REQUIRED - ProjectId *string `json:"projectId"` + ProjectId GetProjectResponseGetProjectIdAttributeType `json:"projectId"` // Timestamp at which the project was last modified. // REQUIRED - UpdateTime *time.Time `json:"updateTime"` + UpdateTime GetProjectResponseGetUpdateTimeAttributeType `json:"updateTime"` } type _GetProjectResponse GetProjectResponse @@ -50,15 +233,15 @@ type _GetProjectResponse GetProjectResponse // 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 NewGetProjectResponse(containerId *string, creationTime *time.Time, lifecycleState *LifecycleState, name *string, parent *Parent, projectId *string, updateTime *time.Time) *GetProjectResponse { +func NewGetProjectResponse(containerId GetProjectResponseGetContainerIdArgType, creationTime GetProjectResponseGetCreationTimeArgType, lifecycleState GetProjectResponseGetLifecycleStateArgType, name GetProjectResponseGetNameArgType, parent GetProjectResponseGetParentArgType, projectId GetProjectResponseGetProjectIdArgType, updateTime GetProjectResponseGetUpdateTimeArgType) *GetProjectResponse { this := GetProjectResponse{} - this.ContainerId = containerId - this.CreationTime = creationTime - this.LifecycleState = lifecycleState - this.Name = name - this.Parent = parent - this.ProjectId = projectId - this.UpdateTime = updateTime + setGetProjectResponseGetContainerIdAttributeType(&this.ContainerId, containerId) + setGetProjectResponseGetCreationTimeAttributeType(&this.CreationTime, creationTime) + setGetProjectResponseGetLifecycleStateAttributeType(&this.LifecycleState, lifecycleState) + setGetProjectResponseGetNameAttributeType(&this.Name, name) + setGetProjectResponseGetParentAttributeType(&this.Parent, parent) + setGetProjectResponseGetProjectIdAttributeType(&this.ProjectId, projectId) + setGetProjectResponseGetUpdateTimeAttributeType(&this.UpdateTime, updateTime) return &this } @@ -71,252 +254,199 @@ func NewGetProjectResponseWithDefaults() *GetProjectResponse { } // GetContainerId returns the ContainerId field value -func (o *GetProjectResponse) GetContainerId() *string { - if o == nil || IsNil(o.ContainerId) { - var ret *string - return ret - } - - return o.ContainerId +func (o *GetProjectResponse) GetContainerId() (ret GetProjectResponseGetContainerIdRetType) { + ret, _ = o.GetContainerIdOk() + return ret } // GetContainerIdOk returns a tuple with the ContainerId field value // and a boolean to check if the value has been set. -func (o *GetProjectResponse) GetContainerIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ContainerId, true +func (o *GetProjectResponse) GetContainerIdOk() (ret GetProjectResponseGetContainerIdRetType, ok bool) { + return getGetProjectResponseGetContainerIdAttributeTypeOk(o.ContainerId) } // SetContainerId sets field value -func (o *GetProjectResponse) SetContainerId(v *string) { - o.ContainerId = v +func (o *GetProjectResponse) SetContainerId(v GetProjectResponseGetContainerIdRetType) { + setGetProjectResponseGetContainerIdAttributeType(&o.ContainerId, v) } // GetCreationTime returns the CreationTime field value -func (o *GetProjectResponse) GetCreationTime() *time.Time { - if o == nil || IsNil(o.CreationTime) { - var ret *time.Time - return ret - } - - return o.CreationTime +func (o *GetProjectResponse) GetCreationTime() (ret GetProjectResponseGetCreationTimeRetType) { + ret, _ = o.GetCreationTimeOk() + return ret } // GetCreationTimeOk returns a tuple with the CreationTime field value // and a boolean to check if the value has been set. -func (o *GetProjectResponse) GetCreationTimeOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.CreationTime, true +func (o *GetProjectResponse) GetCreationTimeOk() (ret GetProjectResponseGetCreationTimeRetType, ok bool) { + return getGetProjectResponseGetCreationTimeAttributeTypeOk(o.CreationTime) } // SetCreationTime sets field value -func (o *GetProjectResponse) SetCreationTime(v *time.Time) { - o.CreationTime = v +func (o *GetProjectResponse) SetCreationTime(v GetProjectResponseGetCreationTimeRetType) { + setGetProjectResponseGetCreationTimeAttributeType(&o.CreationTime, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *GetProjectResponse) GetLabels() *map[string]string { - if o == nil || IsNil(o.Labels) { - var ret *map[string]string - return ret - } - return o.Labels +func (o *GetProjectResponse) GetLabels() (res GetProjectResponseGetLabelsRetType) { + 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 *GetProjectResponse) GetLabelsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Labels) { - return nil, false - } - return o.Labels, true +func (o *GetProjectResponse) GetLabelsOk() (ret GetProjectResponseGetLabelsRetType, ok bool) { + return getGetProjectResponseGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *GetProjectResponse) 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 *GetProjectResponse) SetLabels(v *map[string]string) { - o.Labels = v +func (o *GetProjectResponse) SetLabels(v GetProjectResponseGetLabelsRetType) { + setGetProjectResponseGetLabelsAttributeType(&o.Labels, v) } // GetLifecycleState returns the LifecycleState field value -func (o *GetProjectResponse) GetLifecycleState() *LifecycleState { - if o == nil || IsNil(o.LifecycleState) { - var ret *LifecycleState - return ret - } - - return o.LifecycleState +func (o *GetProjectResponse) GetLifecycleState() (ret GetProjectResponseGetLifecycleStateRetType) { + ret, _ = o.GetLifecycleStateOk() + return ret } // GetLifecycleStateOk returns a tuple with the LifecycleState field value // and a boolean to check if the value has been set. -func (o *GetProjectResponse) GetLifecycleStateOk() (*LifecycleState, bool) { - if o == nil { - return nil, false - } - return o.LifecycleState, true +func (o *GetProjectResponse) GetLifecycleStateOk() (ret GetProjectResponseGetLifecycleStateRetType, ok bool) { + return getGetProjectResponseGetLifecycleStateAttributeTypeOk(o.LifecycleState) } // SetLifecycleState sets field value -func (o *GetProjectResponse) SetLifecycleState(v *LifecycleState) { - o.LifecycleState = v +func (o *GetProjectResponse) SetLifecycleState(v GetProjectResponseGetLifecycleStateRetType) { + setGetProjectResponseGetLifecycleStateAttributeType(&o.LifecycleState, v) } // GetName returns the Name field value -func (o *GetProjectResponse) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *GetProjectResponse) GetName() (ret GetProjectResponseGetNameRetType) { + 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 *GetProjectResponse) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *GetProjectResponse) GetNameOk() (ret GetProjectResponseGetNameRetType, ok bool) { + return getGetProjectResponseGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *GetProjectResponse) SetName(v *string) { - o.Name = v +func (o *GetProjectResponse) SetName(v GetProjectResponseGetNameRetType) { + setGetProjectResponseGetNameAttributeType(&o.Name, v) } // GetParent returns the Parent field value -func (o *GetProjectResponse) GetParent() *Parent { - if o == nil || IsNil(o.Parent) { - var ret *Parent - return ret - } - - return o.Parent +func (o *GetProjectResponse) GetParent() (ret GetProjectResponseGetParentRetType) { + ret, _ = o.GetParentOk() + return ret } // GetParentOk returns a tuple with the Parent field value // and a boolean to check if the value has been set. -func (o *GetProjectResponse) GetParentOk() (*Parent, bool) { - if o == nil { - return nil, false - } - return o.Parent, true +func (o *GetProjectResponse) GetParentOk() (ret GetProjectResponseGetParentRetType, ok bool) { + return getGetProjectResponseGetParentAttributeTypeOk(o.Parent) } // SetParent sets field value -func (o *GetProjectResponse) SetParent(v *Parent) { - o.Parent = v +func (o *GetProjectResponse) SetParent(v GetProjectResponseGetParentRetType) { + setGetProjectResponseGetParentAttributeType(&o.Parent, v) } // GetParents returns the Parents field value if set, zero value otherwise. -func (o *GetProjectResponse) GetParents() *[]ParentListInner { - if o == nil || IsNil(o.Parents) { - var ret *[]ParentListInner - return ret - } - return o.Parents +func (o *GetProjectResponse) GetParents() (res GetProjectResponseGetParentsRetType) { + res, _ = o.GetParentsOk() + return } // GetParentsOk returns a tuple with the Parents field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetProjectResponse) GetParentsOk() (*[]ParentListInner, bool) { - if o == nil || IsNil(o.Parents) { - return nil, false - } - return o.Parents, true +func (o *GetProjectResponse) GetParentsOk() (ret GetProjectResponseGetParentsRetType, ok bool) { + return getGetProjectResponseGetParentsAttributeTypeOk(o.Parents) } // HasParents returns a boolean if a field has been set. func (o *GetProjectResponse) HasParents() bool { - if o != nil && !IsNil(o.Parents) { - return true - } - - return false + _, ok := o.GetParentsOk() + return ok } // SetParents gets a reference to the given []ParentListInner and assigns it to the Parents field. -func (o *GetProjectResponse) SetParents(v *[]ParentListInner) { - o.Parents = v +func (o *GetProjectResponse) SetParents(v GetProjectResponseGetParentsRetType) { + setGetProjectResponseGetParentsAttributeType(&o.Parents, v) } // GetProjectId returns the ProjectId field value -func (o *GetProjectResponse) GetProjectId() *string { - if o == nil || IsNil(o.ProjectId) { - var ret *string - return ret - } - - return o.ProjectId +func (o *GetProjectResponse) GetProjectId() (ret GetProjectResponseGetProjectIdRetType) { + ret, _ = o.GetProjectIdOk() + return ret } // GetProjectIdOk returns a tuple with the ProjectId field value // and a boolean to check if the value has been set. -func (o *GetProjectResponse) GetProjectIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ProjectId, true +func (o *GetProjectResponse) GetProjectIdOk() (ret GetProjectResponseGetProjectIdRetType, ok bool) { + return getGetProjectResponseGetProjectIdAttributeTypeOk(o.ProjectId) } // SetProjectId sets field value -func (o *GetProjectResponse) SetProjectId(v *string) { - o.ProjectId = v +func (o *GetProjectResponse) SetProjectId(v GetProjectResponseGetProjectIdRetType) { + setGetProjectResponseGetProjectIdAttributeType(&o.ProjectId, v) } // GetUpdateTime returns the UpdateTime field value -func (o *GetProjectResponse) GetUpdateTime() *time.Time { - if o == nil || IsNil(o.UpdateTime) { - var ret *time.Time - return ret - } - - return o.UpdateTime +func (o *GetProjectResponse) GetUpdateTime() (ret GetProjectResponseGetUpdateTimeRetType) { + ret, _ = o.GetUpdateTimeOk() + return ret } // GetUpdateTimeOk returns a tuple with the UpdateTime field value // and a boolean to check if the value has been set. -func (o *GetProjectResponse) GetUpdateTimeOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.UpdateTime, true +func (o *GetProjectResponse) GetUpdateTimeOk() (ret GetProjectResponseGetUpdateTimeRetType, ok bool) { + return getGetProjectResponseGetUpdateTimeAttributeTypeOk(o.UpdateTime) } // SetUpdateTime sets field value -func (o *GetProjectResponse) SetUpdateTime(v *time.Time) { - o.UpdateTime = v +func (o *GetProjectResponse) SetUpdateTime(v GetProjectResponseGetUpdateTimeRetType) { + setGetProjectResponseGetUpdateTimeAttributeType(&o.UpdateTime, v) } func (o GetProjectResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["containerId"] = o.ContainerId - toSerialize["creationTime"] = o.CreationTime - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getGetProjectResponseGetContainerIdAttributeTypeOk(o.ContainerId); ok { + toSerialize["ContainerId"] = val + } + if val, ok := getGetProjectResponseGetCreationTimeAttributeTypeOk(o.CreationTime); ok { + toSerialize["CreationTime"] = val + } + if val, ok := getGetProjectResponseGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getGetProjectResponseGetLifecycleStateAttributeTypeOk(o.LifecycleState); ok { + toSerialize["LifecycleState"] = val + } + if val, ok := getGetProjectResponseGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getGetProjectResponseGetParentAttributeTypeOk(o.Parent); ok { + toSerialize["Parent"] = val + } + if val, ok := getGetProjectResponseGetParentsAttributeTypeOk(o.Parents); ok { + toSerialize["Parents"] = val + } + if val, ok := getGetProjectResponseGetProjectIdAttributeTypeOk(o.ProjectId); ok { + toSerialize["ProjectId"] = val } - toSerialize["lifecycleState"] = o.LifecycleState - toSerialize["name"] = o.Name - toSerialize["parent"] = o.Parent - if !IsNil(o.Parents) { - toSerialize["parents"] = o.Parents + if val, ok := getGetProjectResponseGetUpdateTimeAttributeTypeOk(o.UpdateTime); ok { + toSerialize["UpdateTime"] = val } - toSerialize["projectId"] = o.ProjectId - toSerialize["updateTime"] = o.UpdateTime return toSerialize, nil } diff --git a/services/resourcemanager/model_list_organizations_response.go b/services/resourcemanager/model_list_organizations_response.go index 0d61b430c..11bdba573 100644 --- a/services/resourcemanager/model_list_organizations_response.go +++ b/services/resourcemanager/model_list_organizations_response.go @@ -17,16 +17,76 @@ import ( // checks if the ListOrganizationsResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListOrganizationsResponse{} +/* + types and functions for items +*/ + +// isArray +type ListOrganizationsResponseGetItemsAttributeType = *[]ListOrganizationsResponseItemsInner +type ListOrganizationsResponseGetItemsArgType = []ListOrganizationsResponseItemsInner +type ListOrganizationsResponseGetItemsRetType = []ListOrganizationsResponseItemsInner + +func getListOrganizationsResponseGetItemsAttributeTypeOk(arg ListOrganizationsResponseGetItemsAttributeType) (ret ListOrganizationsResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListOrganizationsResponseGetItemsAttributeType(arg *ListOrganizationsResponseGetItemsAttributeType, val ListOrganizationsResponseGetItemsRetType) { + *arg = &val +} + +/* + types and functions for limit +*/ + +// isNumber +type ListOrganizationsResponseGetLimitAttributeType = *float64 +type ListOrganizationsResponseGetLimitArgType = float64 +type ListOrganizationsResponseGetLimitRetType = float64 + +func getListOrganizationsResponseGetLimitAttributeTypeOk(arg ListOrganizationsResponseGetLimitAttributeType) (ret ListOrganizationsResponseGetLimitRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListOrganizationsResponseGetLimitAttributeType(arg *ListOrganizationsResponseGetLimitAttributeType, val ListOrganizationsResponseGetLimitRetType) { + *arg = &val +} + +/* + types and functions for offset +*/ + +// isNumber +type ListOrganizationsResponseGetOffsetAttributeType = *float64 +type ListOrganizationsResponseGetOffsetArgType = float64 +type ListOrganizationsResponseGetOffsetRetType = float64 + +func getListOrganizationsResponseGetOffsetAttributeTypeOk(arg ListOrganizationsResponseGetOffsetAttributeType) (ret ListOrganizationsResponseGetOffsetRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListOrganizationsResponseGetOffsetAttributeType(arg *ListOrganizationsResponseGetOffsetAttributeType, val ListOrganizationsResponseGetOffsetRetType) { + *arg = &val +} + // ListOrganizationsResponse struct for ListOrganizationsResponse type ListOrganizationsResponse struct { // REQUIRED - Items *[]ListOrganizationsResponseItemsInner `json:"items"` + Items ListOrganizationsResponseGetItemsAttributeType `json:"items"` // The maximum number of projects to return in the response. If not present, an appropriate default will be used. // REQUIRED - Limit *float64 `json:"limit"` + Limit ListOrganizationsResponseGetLimitAttributeType `json:"limit"` // The offset of the first item in the collection to return. // REQUIRED - Offset *float64 `json:"offset"` + Offset ListOrganizationsResponseGetOffsetAttributeType `json:"offset"` } type _ListOrganizationsResponse ListOrganizationsResponse @@ -35,11 +95,11 @@ type _ListOrganizationsResponse ListOrganizationsResponse // 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 NewListOrganizationsResponse(items *[]ListOrganizationsResponseItemsInner, limit *float64, offset *float64) *ListOrganizationsResponse { +func NewListOrganizationsResponse(items ListOrganizationsResponseGetItemsArgType, limit ListOrganizationsResponseGetLimitArgType, offset ListOrganizationsResponseGetOffsetArgType) *ListOrganizationsResponse { this := ListOrganizationsResponse{} - this.Items = items - this.Limit = limit - this.Offset = offset + setListOrganizationsResponseGetItemsAttributeType(&this.Items, items) + setListOrganizationsResponseGetLimitAttributeType(&this.Limit, limit) + setListOrganizationsResponseGetOffsetAttributeType(&this.Offset, offset) return &this } @@ -56,82 +116,67 @@ func NewListOrganizationsResponseWithDefaults() *ListOrganizationsResponse { } // GetItems returns the Items field value -func (o *ListOrganizationsResponse) GetItems() *[]ListOrganizationsResponseItemsInner { - if o == nil || IsNil(o.Items) { - var ret *[]ListOrganizationsResponseItemsInner - return ret - } - - return o.Items +func (o *ListOrganizationsResponse) GetItems() (ret ListOrganizationsResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *ListOrganizationsResponse) GetItemsOk() (*[]ListOrganizationsResponseItemsInner, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *ListOrganizationsResponse) GetItemsOk() (ret ListOrganizationsResponseGetItemsRetType, ok bool) { + return getListOrganizationsResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *ListOrganizationsResponse) SetItems(v *[]ListOrganizationsResponseItemsInner) { - o.Items = v +func (o *ListOrganizationsResponse) SetItems(v ListOrganizationsResponseGetItemsRetType) { + setListOrganizationsResponseGetItemsAttributeType(&o.Items, v) } // GetLimit returns the Limit field value -func (o *ListOrganizationsResponse) GetLimit() *float64 { - if o == nil || IsNil(o.Limit) { - var ret *float64 - return ret - } - - return o.Limit +func (o *ListOrganizationsResponse) GetLimit() (ret ListOrganizationsResponseGetLimitRetType) { + ret, _ = o.GetLimitOk() + return ret } // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. -func (o *ListOrganizationsResponse) GetLimitOk() (*float64, bool) { - if o == nil { - return nil, false - } - return o.Limit, true +func (o *ListOrganizationsResponse) GetLimitOk() (ret ListOrganizationsResponseGetLimitRetType, ok bool) { + return getListOrganizationsResponseGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value -func (o *ListOrganizationsResponse) SetLimit(v *float64) { - o.Limit = v +func (o *ListOrganizationsResponse) SetLimit(v ListOrganizationsResponseGetLimitRetType) { + setListOrganizationsResponseGetLimitAttributeType(&o.Limit, v) } // GetOffset returns the Offset field value -func (o *ListOrganizationsResponse) GetOffset() *float64 { - if o == nil || IsNil(o.Offset) { - var ret *float64 - return ret - } - - return o.Offset +func (o *ListOrganizationsResponse) GetOffset() (ret ListOrganizationsResponseGetOffsetRetType) { + ret, _ = o.GetOffsetOk() + return ret } // GetOffsetOk returns a tuple with the Offset field value // and a boolean to check if the value has been set. -func (o *ListOrganizationsResponse) GetOffsetOk() (*float64, bool) { - if o == nil { - return nil, false - } - return o.Offset, true +func (o *ListOrganizationsResponse) GetOffsetOk() (ret ListOrganizationsResponseGetOffsetRetType, ok bool) { + return getListOrganizationsResponseGetOffsetAttributeTypeOk(o.Offset) } // SetOffset sets field value -func (o *ListOrganizationsResponse) SetOffset(v *float64) { - o.Offset = v +func (o *ListOrganizationsResponse) SetOffset(v ListOrganizationsResponseGetOffsetRetType) { + setListOrganizationsResponseGetOffsetAttributeType(&o.Offset, v) } func (o ListOrganizationsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items - toSerialize["limit"] = o.Limit - toSerialize["offset"] = o.Offset + if val, ok := getListOrganizationsResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } + if val, ok := getListOrganizationsResponseGetLimitAttributeTypeOk(o.Limit); ok { + toSerialize["Limit"] = val + } + if val, ok := getListOrganizationsResponseGetOffsetAttributeTypeOk(o.Offset); ok { + toSerialize["Offset"] = val + } return toSerialize, nil } diff --git a/services/resourcemanager/model_list_organizations_response_items_inner.go b/services/resourcemanager/model_list_organizations_response_items_inner.go index aa6bfa179..fb457d759 100644 --- a/services/resourcemanager/model_list_organizations_response_items_inner.go +++ b/services/resourcemanager/model_list_organizations_response_items_inner.go @@ -18,27 +18,170 @@ import ( // checks if the ListOrganizationsResponseItemsInner type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListOrganizationsResponseItemsInner{} +/* + types and functions for containerId +*/ + +// isNotNullableString +type ListOrganizationsResponseItemsInnerGetContainerIdAttributeType = *string + +func getListOrganizationsResponseItemsInnerGetContainerIdAttributeTypeOk(arg ListOrganizationsResponseItemsInnerGetContainerIdAttributeType) (ret ListOrganizationsResponseItemsInnerGetContainerIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListOrganizationsResponseItemsInnerGetContainerIdAttributeType(arg *ListOrganizationsResponseItemsInnerGetContainerIdAttributeType, val ListOrganizationsResponseItemsInnerGetContainerIdRetType) { + *arg = &val +} + +type ListOrganizationsResponseItemsInnerGetContainerIdArgType = string +type ListOrganizationsResponseItemsInnerGetContainerIdRetType = string + +/* + types and functions for creationTime +*/ + +// isDateTime +type ListOrganizationsResponseItemsInnerGetCreationTimeAttributeType = *time.Time +type ListOrganizationsResponseItemsInnerGetCreationTimeArgType = time.Time +type ListOrganizationsResponseItemsInnerGetCreationTimeRetType = time.Time + +func getListOrganizationsResponseItemsInnerGetCreationTimeAttributeTypeOk(arg ListOrganizationsResponseItemsInnerGetCreationTimeAttributeType) (ret ListOrganizationsResponseItemsInnerGetCreationTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListOrganizationsResponseItemsInnerGetCreationTimeAttributeType(arg *ListOrganizationsResponseItemsInnerGetCreationTimeAttributeType, val ListOrganizationsResponseItemsInnerGetCreationTimeRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isContainer +type ListOrganizationsResponseItemsInnerGetLabelsAttributeType = *map[string]string +type ListOrganizationsResponseItemsInnerGetLabelsArgType = map[string]string +type ListOrganizationsResponseItemsInnerGetLabelsRetType = map[string]string + +func getListOrganizationsResponseItemsInnerGetLabelsAttributeTypeOk(arg ListOrganizationsResponseItemsInnerGetLabelsAttributeType) (ret ListOrganizationsResponseItemsInnerGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListOrganizationsResponseItemsInnerGetLabelsAttributeType(arg *ListOrganizationsResponseItemsInnerGetLabelsAttributeType, val ListOrganizationsResponseItemsInnerGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for lifecycleState +*/ + +// isEnumRef +type ListOrganizationsResponseItemsInnerGetLifecycleStateAttributeType = *LifecycleState +type ListOrganizationsResponseItemsInnerGetLifecycleStateArgType = LifecycleState +type ListOrganizationsResponseItemsInnerGetLifecycleStateRetType = LifecycleState + +func getListOrganizationsResponseItemsInnerGetLifecycleStateAttributeTypeOk(arg ListOrganizationsResponseItemsInnerGetLifecycleStateAttributeType) (ret ListOrganizationsResponseItemsInnerGetLifecycleStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListOrganizationsResponseItemsInnerGetLifecycleStateAttributeType(arg *ListOrganizationsResponseItemsInnerGetLifecycleStateAttributeType, val ListOrganizationsResponseItemsInnerGetLifecycleStateRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type ListOrganizationsResponseItemsInnerGetNameAttributeType = *string + +func getListOrganizationsResponseItemsInnerGetNameAttributeTypeOk(arg ListOrganizationsResponseItemsInnerGetNameAttributeType) (ret ListOrganizationsResponseItemsInnerGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListOrganizationsResponseItemsInnerGetNameAttributeType(arg *ListOrganizationsResponseItemsInnerGetNameAttributeType, val ListOrganizationsResponseItemsInnerGetNameRetType) { + *arg = &val +} + +type ListOrganizationsResponseItemsInnerGetNameArgType = string +type ListOrganizationsResponseItemsInnerGetNameRetType = string + +/* + types and functions for organizationId +*/ + +// isNotNullableString +type ListOrganizationsResponseItemsInnerGetOrganizationIdAttributeType = *string + +func getListOrganizationsResponseItemsInnerGetOrganizationIdAttributeTypeOk(arg ListOrganizationsResponseItemsInnerGetOrganizationIdAttributeType) (ret ListOrganizationsResponseItemsInnerGetOrganizationIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListOrganizationsResponseItemsInnerGetOrganizationIdAttributeType(arg *ListOrganizationsResponseItemsInnerGetOrganizationIdAttributeType, val ListOrganizationsResponseItemsInnerGetOrganizationIdRetType) { + *arg = &val +} + +type ListOrganizationsResponseItemsInnerGetOrganizationIdArgType = string +type ListOrganizationsResponseItemsInnerGetOrganizationIdRetType = string + +/* + types and functions for updateTime +*/ + +// isDateTime +type ListOrganizationsResponseItemsInnerGetUpdateTimeAttributeType = *time.Time +type ListOrganizationsResponseItemsInnerGetUpdateTimeArgType = time.Time +type ListOrganizationsResponseItemsInnerGetUpdateTimeRetType = time.Time + +func getListOrganizationsResponseItemsInnerGetUpdateTimeAttributeTypeOk(arg ListOrganizationsResponseItemsInnerGetUpdateTimeAttributeType) (ret ListOrganizationsResponseItemsInnerGetUpdateTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListOrganizationsResponseItemsInnerGetUpdateTimeAttributeType(arg *ListOrganizationsResponseItemsInnerGetUpdateTimeAttributeType, val ListOrganizationsResponseItemsInnerGetUpdateTimeRetType) { + *arg = &val +} + // ListOrganizationsResponseItemsInner struct for ListOrganizationsResponseItemsInner type ListOrganizationsResponseItemsInner struct { // Globally unique, user-friendly identifier. // REQUIRED - ContainerId *string `json:"containerId"` + ContainerId ListOrganizationsResponseItemsInnerGetContainerIdAttributeType `json:"containerId"` // Timestamp at which the organization was created. // REQUIRED - CreationTime *time.Time `json:"creationTime"` + CreationTime ListOrganizationsResponseItemsInnerGetCreationTimeAttributeType `json:"creationTime"` // Labels are key-value string pairs that can be attached to a resource container. Some labels may be enforced via policies. - A label key must match the regex `[A-ZÄÜÖa-zäüöß0-9_-]{1,64}`. - A label value must match the regex `^$|[A-ZÄÜÖa-zäüöß0-9_-]{1,64}`. - Labels *map[string]string `json:"labels,omitempty"` + Labels ListOrganizationsResponseItemsInnerGetLabelsAttributeType `json:"labels,omitempty"` // REQUIRED - LifecycleState *LifecycleState `json:"lifecycleState"` + LifecycleState ListOrganizationsResponseItemsInnerGetLifecycleStateAttributeType `json:"lifecycleState"` // Name of the organization. // REQUIRED - Name *string `json:"name"` + Name ListOrganizationsResponseItemsInnerGetNameAttributeType `json:"name"` // Globally unique, organization identifier. // REQUIRED - OrganizationId *string `json:"organizationId"` + OrganizationId ListOrganizationsResponseItemsInnerGetOrganizationIdAttributeType `json:"organizationId"` // Timestamp at which the organization was last modified. // REQUIRED - UpdateTime *time.Time `json:"updateTime"` + UpdateTime ListOrganizationsResponseItemsInnerGetUpdateTimeAttributeType `json:"updateTime"` } type _ListOrganizationsResponseItemsInner ListOrganizationsResponseItemsInner @@ -47,14 +190,14 @@ type _ListOrganizationsResponseItemsInner ListOrganizationsResponseItemsInner // 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 NewListOrganizationsResponseItemsInner(containerId *string, creationTime *time.Time, lifecycleState *LifecycleState, name *string, organizationId *string, updateTime *time.Time) *ListOrganizationsResponseItemsInner { +func NewListOrganizationsResponseItemsInner(containerId ListOrganizationsResponseItemsInnerGetContainerIdArgType, creationTime ListOrganizationsResponseItemsInnerGetCreationTimeArgType, lifecycleState ListOrganizationsResponseItemsInnerGetLifecycleStateArgType, name ListOrganizationsResponseItemsInnerGetNameArgType, organizationId ListOrganizationsResponseItemsInnerGetOrganizationIdArgType, updateTime ListOrganizationsResponseItemsInnerGetUpdateTimeArgType) *ListOrganizationsResponseItemsInner { this := ListOrganizationsResponseItemsInner{} - this.ContainerId = containerId - this.CreationTime = creationTime - this.LifecycleState = lifecycleState - this.Name = name - this.OrganizationId = organizationId - this.UpdateTime = updateTime + setListOrganizationsResponseItemsInnerGetContainerIdAttributeType(&this.ContainerId, containerId) + setListOrganizationsResponseItemsInnerGetCreationTimeAttributeType(&this.CreationTime, creationTime) + setListOrganizationsResponseItemsInnerGetLifecycleStateAttributeType(&this.LifecycleState, lifecycleState) + setListOrganizationsResponseItemsInnerGetNameAttributeType(&this.Name, name) + setListOrganizationsResponseItemsInnerGetOrganizationIdAttributeType(&this.OrganizationId, organizationId) + setListOrganizationsResponseItemsInnerGetUpdateTimeAttributeType(&this.UpdateTime, updateTime) return &this } @@ -67,192 +210,153 @@ func NewListOrganizationsResponseItemsInnerWithDefaults() *ListOrganizationsResp } // GetContainerId returns the ContainerId field value -func (o *ListOrganizationsResponseItemsInner) GetContainerId() *string { - if o == nil || IsNil(o.ContainerId) { - var ret *string - return ret - } - - return o.ContainerId +func (o *ListOrganizationsResponseItemsInner) GetContainerId() (ret ListOrganizationsResponseItemsInnerGetContainerIdRetType) { + ret, _ = o.GetContainerIdOk() + return ret } // GetContainerIdOk returns a tuple with the ContainerId field value // and a boolean to check if the value has been set. -func (o *ListOrganizationsResponseItemsInner) GetContainerIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ContainerId, true +func (o *ListOrganizationsResponseItemsInner) GetContainerIdOk() (ret ListOrganizationsResponseItemsInnerGetContainerIdRetType, ok bool) { + return getListOrganizationsResponseItemsInnerGetContainerIdAttributeTypeOk(o.ContainerId) } // SetContainerId sets field value -func (o *ListOrganizationsResponseItemsInner) SetContainerId(v *string) { - o.ContainerId = v +func (o *ListOrganizationsResponseItemsInner) SetContainerId(v ListOrganizationsResponseItemsInnerGetContainerIdRetType) { + setListOrganizationsResponseItemsInnerGetContainerIdAttributeType(&o.ContainerId, v) } // GetCreationTime returns the CreationTime field value -func (o *ListOrganizationsResponseItemsInner) GetCreationTime() *time.Time { - if o == nil || IsNil(o.CreationTime) { - var ret *time.Time - return ret - } - - return o.CreationTime +func (o *ListOrganizationsResponseItemsInner) GetCreationTime() (ret ListOrganizationsResponseItemsInnerGetCreationTimeRetType) { + ret, _ = o.GetCreationTimeOk() + return ret } // GetCreationTimeOk returns a tuple with the CreationTime field value // and a boolean to check if the value has been set. -func (o *ListOrganizationsResponseItemsInner) GetCreationTimeOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.CreationTime, true +func (o *ListOrganizationsResponseItemsInner) GetCreationTimeOk() (ret ListOrganizationsResponseItemsInnerGetCreationTimeRetType, ok bool) { + return getListOrganizationsResponseItemsInnerGetCreationTimeAttributeTypeOk(o.CreationTime) } // SetCreationTime sets field value -func (o *ListOrganizationsResponseItemsInner) SetCreationTime(v *time.Time) { - o.CreationTime = v +func (o *ListOrganizationsResponseItemsInner) SetCreationTime(v ListOrganizationsResponseItemsInnerGetCreationTimeRetType) { + setListOrganizationsResponseItemsInnerGetCreationTimeAttributeType(&o.CreationTime, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *ListOrganizationsResponseItemsInner) GetLabels() *map[string]string { - if o == nil || IsNil(o.Labels) { - var ret *map[string]string - return ret - } - return o.Labels +func (o *ListOrganizationsResponseItemsInner) GetLabels() (res ListOrganizationsResponseItemsInnerGetLabelsRetType) { + 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 *ListOrganizationsResponseItemsInner) GetLabelsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Labels) { - return nil, false - } - return o.Labels, true +func (o *ListOrganizationsResponseItemsInner) GetLabelsOk() (ret ListOrganizationsResponseItemsInnerGetLabelsRetType, ok bool) { + return getListOrganizationsResponseItemsInnerGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *ListOrganizationsResponseItemsInner) 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 *ListOrganizationsResponseItemsInner) SetLabels(v *map[string]string) { - o.Labels = v +func (o *ListOrganizationsResponseItemsInner) SetLabels(v ListOrganizationsResponseItemsInnerGetLabelsRetType) { + setListOrganizationsResponseItemsInnerGetLabelsAttributeType(&o.Labels, v) } // GetLifecycleState returns the LifecycleState field value -func (o *ListOrganizationsResponseItemsInner) GetLifecycleState() *LifecycleState { - if o == nil || IsNil(o.LifecycleState) { - var ret *LifecycleState - return ret - } - - return o.LifecycleState +func (o *ListOrganizationsResponseItemsInner) GetLifecycleState() (ret ListOrganizationsResponseItemsInnerGetLifecycleStateRetType) { + ret, _ = o.GetLifecycleStateOk() + return ret } // GetLifecycleStateOk returns a tuple with the LifecycleState field value // and a boolean to check if the value has been set. -func (o *ListOrganizationsResponseItemsInner) GetLifecycleStateOk() (*LifecycleState, bool) { - if o == nil { - return nil, false - } - return o.LifecycleState, true +func (o *ListOrganizationsResponseItemsInner) GetLifecycleStateOk() (ret ListOrganizationsResponseItemsInnerGetLifecycleStateRetType, ok bool) { + return getListOrganizationsResponseItemsInnerGetLifecycleStateAttributeTypeOk(o.LifecycleState) } // SetLifecycleState sets field value -func (o *ListOrganizationsResponseItemsInner) SetLifecycleState(v *LifecycleState) { - o.LifecycleState = v +func (o *ListOrganizationsResponseItemsInner) SetLifecycleState(v ListOrganizationsResponseItemsInnerGetLifecycleStateRetType) { + setListOrganizationsResponseItemsInnerGetLifecycleStateAttributeType(&o.LifecycleState, v) } // GetName returns the Name field value -func (o *ListOrganizationsResponseItemsInner) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *ListOrganizationsResponseItemsInner) GetName() (ret ListOrganizationsResponseItemsInnerGetNameRetType) { + 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 *ListOrganizationsResponseItemsInner) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *ListOrganizationsResponseItemsInner) GetNameOk() (ret ListOrganizationsResponseItemsInnerGetNameRetType, ok bool) { + return getListOrganizationsResponseItemsInnerGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *ListOrganizationsResponseItemsInner) SetName(v *string) { - o.Name = v +func (o *ListOrganizationsResponseItemsInner) SetName(v ListOrganizationsResponseItemsInnerGetNameRetType) { + setListOrganizationsResponseItemsInnerGetNameAttributeType(&o.Name, v) } // GetOrganizationId returns the OrganizationId field value -func (o *ListOrganizationsResponseItemsInner) GetOrganizationId() *string { - if o == nil || IsNil(o.OrganizationId) { - var ret *string - return ret - } - - return o.OrganizationId +func (o *ListOrganizationsResponseItemsInner) GetOrganizationId() (ret ListOrganizationsResponseItemsInnerGetOrganizationIdRetType) { + ret, _ = o.GetOrganizationIdOk() + return ret } // GetOrganizationIdOk returns a tuple with the OrganizationId field value // and a boolean to check if the value has been set. -func (o *ListOrganizationsResponseItemsInner) GetOrganizationIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.OrganizationId, true +func (o *ListOrganizationsResponseItemsInner) GetOrganizationIdOk() (ret ListOrganizationsResponseItemsInnerGetOrganizationIdRetType, ok bool) { + return getListOrganizationsResponseItemsInnerGetOrganizationIdAttributeTypeOk(o.OrganizationId) } // SetOrganizationId sets field value -func (o *ListOrganizationsResponseItemsInner) SetOrganizationId(v *string) { - o.OrganizationId = v +func (o *ListOrganizationsResponseItemsInner) SetOrganizationId(v ListOrganizationsResponseItemsInnerGetOrganizationIdRetType) { + setListOrganizationsResponseItemsInnerGetOrganizationIdAttributeType(&o.OrganizationId, v) } // GetUpdateTime returns the UpdateTime field value -func (o *ListOrganizationsResponseItemsInner) GetUpdateTime() *time.Time { - if o == nil || IsNil(o.UpdateTime) { - var ret *time.Time - return ret - } - - return o.UpdateTime +func (o *ListOrganizationsResponseItemsInner) GetUpdateTime() (ret ListOrganizationsResponseItemsInnerGetUpdateTimeRetType) { + ret, _ = o.GetUpdateTimeOk() + return ret } // GetUpdateTimeOk returns a tuple with the UpdateTime field value // and a boolean to check if the value has been set. -func (o *ListOrganizationsResponseItemsInner) GetUpdateTimeOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.UpdateTime, true +func (o *ListOrganizationsResponseItemsInner) GetUpdateTimeOk() (ret ListOrganizationsResponseItemsInnerGetUpdateTimeRetType, ok bool) { + return getListOrganizationsResponseItemsInnerGetUpdateTimeAttributeTypeOk(o.UpdateTime) } // SetUpdateTime sets field value -func (o *ListOrganizationsResponseItemsInner) SetUpdateTime(v *time.Time) { - o.UpdateTime = v +func (o *ListOrganizationsResponseItemsInner) SetUpdateTime(v ListOrganizationsResponseItemsInnerGetUpdateTimeRetType) { + setListOrganizationsResponseItemsInnerGetUpdateTimeAttributeType(&o.UpdateTime, v) } func (o ListOrganizationsResponseItemsInner) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["containerId"] = o.ContainerId - toSerialize["creationTime"] = o.CreationTime - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getListOrganizationsResponseItemsInnerGetContainerIdAttributeTypeOk(o.ContainerId); ok { + toSerialize["ContainerId"] = val + } + if val, ok := getListOrganizationsResponseItemsInnerGetCreationTimeAttributeTypeOk(o.CreationTime); ok { + toSerialize["CreationTime"] = val + } + if val, ok := getListOrganizationsResponseItemsInnerGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getListOrganizationsResponseItemsInnerGetLifecycleStateAttributeTypeOk(o.LifecycleState); ok { + toSerialize["LifecycleState"] = val + } + if val, ok := getListOrganizationsResponseItemsInnerGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getListOrganizationsResponseItemsInnerGetOrganizationIdAttributeTypeOk(o.OrganizationId); ok { + toSerialize["OrganizationId"] = val + } + if val, ok := getListOrganizationsResponseItemsInnerGetUpdateTimeAttributeTypeOk(o.UpdateTime); ok { + toSerialize["UpdateTime"] = val } - toSerialize["lifecycleState"] = o.LifecycleState - toSerialize["name"] = o.Name - toSerialize["organizationId"] = o.OrganizationId - toSerialize["updateTime"] = o.UpdateTime return toSerialize, nil } diff --git a/services/resourcemanager/model_list_projects_response.go b/services/resourcemanager/model_list_projects_response.go index caa62e57b..d1a6b9d09 100644 --- a/services/resourcemanager/model_list_projects_response.go +++ b/services/resourcemanager/model_list_projects_response.go @@ -17,16 +17,76 @@ import ( // checks if the ListProjectsResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListProjectsResponse{} +/* + types and functions for items +*/ + +// isArray +type ListProjectsResponseGetItemsAttributeType = *[]Project +type ListProjectsResponseGetItemsArgType = []Project +type ListProjectsResponseGetItemsRetType = []Project + +func getListProjectsResponseGetItemsAttributeTypeOk(arg ListProjectsResponseGetItemsAttributeType) (ret ListProjectsResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListProjectsResponseGetItemsAttributeType(arg *ListProjectsResponseGetItemsAttributeType, val ListProjectsResponseGetItemsRetType) { + *arg = &val +} + +/* + types and functions for limit +*/ + +// isNumber +type ListProjectsResponseGetLimitAttributeType = *float64 +type ListProjectsResponseGetLimitArgType = float64 +type ListProjectsResponseGetLimitRetType = float64 + +func getListProjectsResponseGetLimitAttributeTypeOk(arg ListProjectsResponseGetLimitAttributeType) (ret ListProjectsResponseGetLimitRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListProjectsResponseGetLimitAttributeType(arg *ListProjectsResponseGetLimitAttributeType, val ListProjectsResponseGetLimitRetType) { + *arg = &val +} + +/* + types and functions for offset +*/ + +// isNumber +type ListProjectsResponseGetOffsetAttributeType = *float64 +type ListProjectsResponseGetOffsetArgType = float64 +type ListProjectsResponseGetOffsetRetType = float64 + +func getListProjectsResponseGetOffsetAttributeTypeOk(arg ListProjectsResponseGetOffsetAttributeType) (ret ListProjectsResponseGetOffsetRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListProjectsResponseGetOffsetAttributeType(arg *ListProjectsResponseGetOffsetAttributeType, val ListProjectsResponseGetOffsetRetType) { + *arg = &val +} + // ListProjectsResponse struct for ListProjectsResponse type ListProjectsResponse struct { // REQUIRED - Items *[]Project `json:"items"` + Items ListProjectsResponseGetItemsAttributeType `json:"items"` // The maximum number of projects to return in the response. If not present, an appropriate default will be used. // REQUIRED - Limit *float64 `json:"limit"` + Limit ListProjectsResponseGetLimitAttributeType `json:"limit"` // The offset of the first item in the collection to return. // REQUIRED - Offset *float64 `json:"offset"` + Offset ListProjectsResponseGetOffsetAttributeType `json:"offset"` } type _ListProjectsResponse ListProjectsResponse @@ -35,11 +95,11 @@ type _ListProjectsResponse ListProjectsResponse // 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 NewListProjectsResponse(items *[]Project, limit *float64, offset *float64) *ListProjectsResponse { +func NewListProjectsResponse(items ListProjectsResponseGetItemsArgType, limit ListProjectsResponseGetLimitArgType, offset ListProjectsResponseGetOffsetArgType) *ListProjectsResponse { this := ListProjectsResponse{} - this.Items = items - this.Limit = limit - this.Offset = offset + setListProjectsResponseGetItemsAttributeType(&this.Items, items) + setListProjectsResponseGetLimitAttributeType(&this.Limit, limit) + setListProjectsResponseGetOffsetAttributeType(&this.Offset, offset) return &this } @@ -56,82 +116,67 @@ func NewListProjectsResponseWithDefaults() *ListProjectsResponse { } // GetItems returns the Items field value -func (o *ListProjectsResponse) GetItems() *[]Project { - if o == nil || IsNil(o.Items) { - var ret *[]Project - return ret - } - - return o.Items +func (o *ListProjectsResponse) GetItems() (ret ListProjectsResponseGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret } // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. -func (o *ListProjectsResponse) GetItemsOk() (*[]Project, bool) { - if o == nil { - return nil, false - } - return o.Items, true +func (o *ListProjectsResponse) GetItemsOk() (ret ListProjectsResponseGetItemsRetType, ok bool) { + return getListProjectsResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value -func (o *ListProjectsResponse) SetItems(v *[]Project) { - o.Items = v +func (o *ListProjectsResponse) SetItems(v ListProjectsResponseGetItemsRetType) { + setListProjectsResponseGetItemsAttributeType(&o.Items, v) } // GetLimit returns the Limit field value -func (o *ListProjectsResponse) GetLimit() *float64 { - if o == nil || IsNil(o.Limit) { - var ret *float64 - return ret - } - - return o.Limit +func (o *ListProjectsResponse) GetLimit() (ret ListProjectsResponseGetLimitRetType) { + ret, _ = o.GetLimitOk() + return ret } // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. -func (o *ListProjectsResponse) GetLimitOk() (*float64, bool) { - if o == nil { - return nil, false - } - return o.Limit, true +func (o *ListProjectsResponse) GetLimitOk() (ret ListProjectsResponseGetLimitRetType, ok bool) { + return getListProjectsResponseGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value -func (o *ListProjectsResponse) SetLimit(v *float64) { - o.Limit = v +func (o *ListProjectsResponse) SetLimit(v ListProjectsResponseGetLimitRetType) { + setListProjectsResponseGetLimitAttributeType(&o.Limit, v) } // GetOffset returns the Offset field value -func (o *ListProjectsResponse) GetOffset() *float64 { - if o == nil || IsNil(o.Offset) { - var ret *float64 - return ret - } - - return o.Offset +func (o *ListProjectsResponse) GetOffset() (ret ListProjectsResponseGetOffsetRetType) { + ret, _ = o.GetOffsetOk() + return ret } // GetOffsetOk returns a tuple with the Offset field value // and a boolean to check if the value has been set. -func (o *ListProjectsResponse) GetOffsetOk() (*float64, bool) { - if o == nil { - return nil, false - } - return o.Offset, true +func (o *ListProjectsResponse) GetOffsetOk() (ret ListProjectsResponseGetOffsetRetType, ok bool) { + return getListProjectsResponseGetOffsetAttributeTypeOk(o.Offset) } // SetOffset sets field value -func (o *ListProjectsResponse) SetOffset(v *float64) { - o.Offset = v +func (o *ListProjectsResponse) SetOffset(v ListProjectsResponseGetOffsetRetType) { + setListProjectsResponseGetOffsetAttributeType(&o.Offset, v) } func (o ListProjectsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["items"] = o.Items - toSerialize["limit"] = o.Limit - toSerialize["offset"] = o.Offset + if val, ok := getListProjectsResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } + if val, ok := getListProjectsResponseGetLimitAttributeTypeOk(o.Limit); ok { + toSerialize["Limit"] = val + } + if val, ok := getListProjectsResponseGetOffsetAttributeTypeOk(o.Offset); ok { + toSerialize["Offset"] = val + } return toSerialize, nil } diff --git a/services/resourcemanager/model_member.go b/services/resourcemanager/model_member.go index 286544d20..ab6662727 100644 --- a/services/resourcemanager/model_member.go +++ b/services/resourcemanager/model_member.go @@ -17,14 +17,56 @@ import ( // checks if the Member type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Member{} +/* + types and functions for role +*/ + +// isNotNullableString +type MemberGetRoleAttributeType = *string + +func getMemberGetRoleAttributeTypeOk(arg MemberGetRoleAttributeType) (ret MemberGetRoleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMemberGetRoleAttributeType(arg *MemberGetRoleAttributeType, val MemberGetRoleRetType) { + *arg = &val +} + +type MemberGetRoleArgType = string +type MemberGetRoleRetType = string + +/* + types and functions for subject +*/ + +// isNotNullableString +type MemberGetSubjectAttributeType = *string + +func getMemberGetSubjectAttributeTypeOk(arg MemberGetSubjectAttributeType) (ret MemberGetSubjectRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setMemberGetSubjectAttributeType(arg *MemberGetSubjectAttributeType, val MemberGetSubjectRetType) { + *arg = &val +} + +type MemberGetSubjectArgType = string +type MemberGetSubjectRetType = string + // Member struct for Member type Member struct { // A valid role defined for the resource. // REQUIRED - Role *string `json:"role"` + Role MemberGetRoleAttributeType `json:"role"` // Unique identifier of the user, service account or client. // REQUIRED - Subject *string `json:"subject"` + Subject MemberGetSubjectAttributeType `json:"subject"` } type _Member Member @@ -33,10 +75,10 @@ type _Member Member // 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 NewMember(role *string, subject *string) *Member { +func NewMember(role MemberGetRoleArgType, subject MemberGetSubjectArgType) *Member { this := Member{} - this.Role = role - this.Subject = subject + setMemberGetRoleAttributeType(&this.Role, role) + setMemberGetSubjectAttributeType(&this.Subject, subject) return &this } @@ -49,57 +91,47 @@ func NewMemberWithDefaults() *Member { } // GetRole returns the Role field value -func (o *Member) GetRole() *string { - if o == nil || IsNil(o.Role) { - var ret *string - return ret - } - - return o.Role +func (o *Member) GetRole() (ret MemberGetRoleRetType) { + ret, _ = o.GetRoleOk() + return ret } // GetRoleOk returns a tuple with the Role field value // and a boolean to check if the value has been set. -func (o *Member) GetRoleOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Role, true +func (o *Member) GetRoleOk() (ret MemberGetRoleRetType, ok bool) { + return getMemberGetRoleAttributeTypeOk(o.Role) } // SetRole sets field value -func (o *Member) SetRole(v *string) { - o.Role = v +func (o *Member) SetRole(v MemberGetRoleRetType) { + setMemberGetRoleAttributeType(&o.Role, v) } // GetSubject returns the Subject field value -func (o *Member) GetSubject() *string { - if o == nil || IsNil(o.Subject) { - var ret *string - return ret - } - - return o.Subject +func (o *Member) GetSubject() (ret MemberGetSubjectRetType) { + ret, _ = o.GetSubjectOk() + return ret } // GetSubjectOk returns a tuple with the Subject field value // and a boolean to check if the value has been set. -func (o *Member) GetSubjectOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Subject, true +func (o *Member) GetSubjectOk() (ret MemberGetSubjectRetType, ok bool) { + return getMemberGetSubjectAttributeTypeOk(o.Subject) } // SetSubject sets field value -func (o *Member) SetSubject(v *string) { - o.Subject = v +func (o *Member) SetSubject(v MemberGetSubjectRetType) { + setMemberGetSubjectAttributeType(&o.Subject, v) } func (o Member) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["role"] = o.Role - toSerialize["subject"] = o.Subject + if val, ok := getMemberGetRoleAttributeTypeOk(o.Role); ok { + toSerialize["Role"] = val + } + if val, ok := getMemberGetSubjectAttributeTypeOk(o.Subject); ok { + toSerialize["Subject"] = val + } return toSerialize, nil } diff --git a/services/resourcemanager/model_organization_response.go b/services/resourcemanager/model_organization_response.go index f2734f00e..dfd66ce76 100644 --- a/services/resourcemanager/model_organization_response.go +++ b/services/resourcemanager/model_organization_response.go @@ -18,27 +18,170 @@ import ( // checks if the OrganizationResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &OrganizationResponse{} +/* + types and functions for containerId +*/ + +// isNotNullableString +type OrganizationResponseGetContainerIdAttributeType = *string + +func getOrganizationResponseGetContainerIdAttributeTypeOk(arg OrganizationResponseGetContainerIdAttributeType) (ret OrganizationResponseGetContainerIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setOrganizationResponseGetContainerIdAttributeType(arg *OrganizationResponseGetContainerIdAttributeType, val OrganizationResponseGetContainerIdRetType) { + *arg = &val +} + +type OrganizationResponseGetContainerIdArgType = string +type OrganizationResponseGetContainerIdRetType = string + +/* + types and functions for creationTime +*/ + +// isDateTime +type OrganizationResponseGetCreationTimeAttributeType = *time.Time +type OrganizationResponseGetCreationTimeArgType = time.Time +type OrganizationResponseGetCreationTimeRetType = time.Time + +func getOrganizationResponseGetCreationTimeAttributeTypeOk(arg OrganizationResponseGetCreationTimeAttributeType) (ret OrganizationResponseGetCreationTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setOrganizationResponseGetCreationTimeAttributeType(arg *OrganizationResponseGetCreationTimeAttributeType, val OrganizationResponseGetCreationTimeRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isContainer +type OrganizationResponseGetLabelsAttributeType = *map[string]string +type OrganizationResponseGetLabelsArgType = map[string]string +type OrganizationResponseGetLabelsRetType = map[string]string + +func getOrganizationResponseGetLabelsAttributeTypeOk(arg OrganizationResponseGetLabelsAttributeType) (ret OrganizationResponseGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setOrganizationResponseGetLabelsAttributeType(arg *OrganizationResponseGetLabelsAttributeType, val OrganizationResponseGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for lifecycleState +*/ + +// isEnumRef +type OrganizationResponseGetLifecycleStateAttributeType = *LifecycleState +type OrganizationResponseGetLifecycleStateArgType = LifecycleState +type OrganizationResponseGetLifecycleStateRetType = LifecycleState + +func getOrganizationResponseGetLifecycleStateAttributeTypeOk(arg OrganizationResponseGetLifecycleStateAttributeType) (ret OrganizationResponseGetLifecycleStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setOrganizationResponseGetLifecycleStateAttributeType(arg *OrganizationResponseGetLifecycleStateAttributeType, val OrganizationResponseGetLifecycleStateRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type OrganizationResponseGetNameAttributeType = *string + +func getOrganizationResponseGetNameAttributeTypeOk(arg OrganizationResponseGetNameAttributeType) (ret OrganizationResponseGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setOrganizationResponseGetNameAttributeType(arg *OrganizationResponseGetNameAttributeType, val OrganizationResponseGetNameRetType) { + *arg = &val +} + +type OrganizationResponseGetNameArgType = string +type OrganizationResponseGetNameRetType = string + +/* + types and functions for organizationId +*/ + +// isNotNullableString +type OrganizationResponseGetOrganizationIdAttributeType = *string + +func getOrganizationResponseGetOrganizationIdAttributeTypeOk(arg OrganizationResponseGetOrganizationIdAttributeType) (ret OrganizationResponseGetOrganizationIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setOrganizationResponseGetOrganizationIdAttributeType(arg *OrganizationResponseGetOrganizationIdAttributeType, val OrganizationResponseGetOrganizationIdRetType) { + *arg = &val +} + +type OrganizationResponseGetOrganizationIdArgType = string +type OrganizationResponseGetOrganizationIdRetType = string + +/* + types and functions for updateTime +*/ + +// isDateTime +type OrganizationResponseGetUpdateTimeAttributeType = *time.Time +type OrganizationResponseGetUpdateTimeArgType = time.Time +type OrganizationResponseGetUpdateTimeRetType = time.Time + +func getOrganizationResponseGetUpdateTimeAttributeTypeOk(arg OrganizationResponseGetUpdateTimeAttributeType) (ret OrganizationResponseGetUpdateTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setOrganizationResponseGetUpdateTimeAttributeType(arg *OrganizationResponseGetUpdateTimeAttributeType, val OrganizationResponseGetUpdateTimeRetType) { + *arg = &val +} + // OrganizationResponse struct for OrganizationResponse type OrganizationResponse struct { // Globally unique, user-friendly identifier. // REQUIRED - ContainerId *string `json:"containerId"` + ContainerId OrganizationResponseGetContainerIdAttributeType `json:"containerId"` // Timestamp at which the organization was created. // REQUIRED - CreationTime *time.Time `json:"creationTime"` + CreationTime OrganizationResponseGetCreationTimeAttributeType `json:"creationTime"` // Labels are key-value string pairs that can be attached to a resource container. Some labels may be enforced via policies. - A label key must match the regex `[A-ZÄÜÖa-zäüöß0-9_-]{1,64}`. - A label value must match the regex `^$|[A-ZÄÜÖa-zäüöß0-9_-]{1,64}`. - Labels *map[string]string `json:"labels,omitempty"` + Labels OrganizationResponseGetLabelsAttributeType `json:"labels,omitempty"` // REQUIRED - LifecycleState *LifecycleState `json:"lifecycleState"` + LifecycleState OrganizationResponseGetLifecycleStateAttributeType `json:"lifecycleState"` // Organization name. // REQUIRED - Name *string `json:"name"` + Name OrganizationResponseGetNameAttributeType `json:"name"` // Globally unique, organization identifier. // REQUIRED - OrganizationId *string `json:"organizationId"` + OrganizationId OrganizationResponseGetOrganizationIdAttributeType `json:"organizationId"` // Timestamp at which the organization was last modified. // REQUIRED - UpdateTime *time.Time `json:"updateTime"` + UpdateTime OrganizationResponseGetUpdateTimeAttributeType `json:"updateTime"` } type _OrganizationResponse OrganizationResponse @@ -47,14 +190,14 @@ type _OrganizationResponse OrganizationResponse // 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 NewOrganizationResponse(containerId *string, creationTime *time.Time, lifecycleState *LifecycleState, name *string, organizationId *string, updateTime *time.Time) *OrganizationResponse { +func NewOrganizationResponse(containerId OrganizationResponseGetContainerIdArgType, creationTime OrganizationResponseGetCreationTimeArgType, lifecycleState OrganizationResponseGetLifecycleStateArgType, name OrganizationResponseGetNameArgType, organizationId OrganizationResponseGetOrganizationIdArgType, updateTime OrganizationResponseGetUpdateTimeArgType) *OrganizationResponse { this := OrganizationResponse{} - this.ContainerId = containerId - this.CreationTime = creationTime - this.LifecycleState = lifecycleState - this.Name = name - this.OrganizationId = organizationId - this.UpdateTime = updateTime + setOrganizationResponseGetContainerIdAttributeType(&this.ContainerId, containerId) + setOrganizationResponseGetCreationTimeAttributeType(&this.CreationTime, creationTime) + setOrganizationResponseGetLifecycleStateAttributeType(&this.LifecycleState, lifecycleState) + setOrganizationResponseGetNameAttributeType(&this.Name, name) + setOrganizationResponseGetOrganizationIdAttributeType(&this.OrganizationId, organizationId) + setOrganizationResponseGetUpdateTimeAttributeType(&this.UpdateTime, updateTime) return &this } @@ -67,192 +210,153 @@ func NewOrganizationResponseWithDefaults() *OrganizationResponse { } // GetContainerId returns the ContainerId field value -func (o *OrganizationResponse) GetContainerId() *string { - if o == nil || IsNil(o.ContainerId) { - var ret *string - return ret - } - - return o.ContainerId +func (o *OrganizationResponse) GetContainerId() (ret OrganizationResponseGetContainerIdRetType) { + ret, _ = o.GetContainerIdOk() + return ret } // GetContainerIdOk returns a tuple with the ContainerId field value // and a boolean to check if the value has been set. -func (o *OrganizationResponse) GetContainerIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ContainerId, true +func (o *OrganizationResponse) GetContainerIdOk() (ret OrganizationResponseGetContainerIdRetType, ok bool) { + return getOrganizationResponseGetContainerIdAttributeTypeOk(o.ContainerId) } // SetContainerId sets field value -func (o *OrganizationResponse) SetContainerId(v *string) { - o.ContainerId = v +func (o *OrganizationResponse) SetContainerId(v OrganizationResponseGetContainerIdRetType) { + setOrganizationResponseGetContainerIdAttributeType(&o.ContainerId, v) } // GetCreationTime returns the CreationTime field value -func (o *OrganizationResponse) GetCreationTime() *time.Time { - if o == nil || IsNil(o.CreationTime) { - var ret *time.Time - return ret - } - - return o.CreationTime +func (o *OrganizationResponse) GetCreationTime() (ret OrganizationResponseGetCreationTimeRetType) { + ret, _ = o.GetCreationTimeOk() + return ret } // GetCreationTimeOk returns a tuple with the CreationTime field value // and a boolean to check if the value has been set. -func (o *OrganizationResponse) GetCreationTimeOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.CreationTime, true +func (o *OrganizationResponse) GetCreationTimeOk() (ret OrganizationResponseGetCreationTimeRetType, ok bool) { + return getOrganizationResponseGetCreationTimeAttributeTypeOk(o.CreationTime) } // SetCreationTime sets field value -func (o *OrganizationResponse) SetCreationTime(v *time.Time) { - o.CreationTime = v +func (o *OrganizationResponse) SetCreationTime(v OrganizationResponseGetCreationTimeRetType) { + setOrganizationResponseGetCreationTimeAttributeType(&o.CreationTime, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *OrganizationResponse) GetLabels() *map[string]string { - if o == nil || IsNil(o.Labels) { - var ret *map[string]string - return ret - } - return o.Labels +func (o *OrganizationResponse) GetLabels() (res OrganizationResponseGetLabelsRetType) { + 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 *OrganizationResponse) GetLabelsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Labels) { - return nil, false - } - return o.Labels, true +func (o *OrganizationResponse) GetLabelsOk() (ret OrganizationResponseGetLabelsRetType, ok bool) { + return getOrganizationResponseGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *OrganizationResponse) 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 *OrganizationResponse) SetLabels(v *map[string]string) { - o.Labels = v +func (o *OrganizationResponse) SetLabels(v OrganizationResponseGetLabelsRetType) { + setOrganizationResponseGetLabelsAttributeType(&o.Labels, v) } // GetLifecycleState returns the LifecycleState field value -func (o *OrganizationResponse) GetLifecycleState() *LifecycleState { - if o == nil || IsNil(o.LifecycleState) { - var ret *LifecycleState - return ret - } - - return o.LifecycleState +func (o *OrganizationResponse) GetLifecycleState() (ret OrganizationResponseGetLifecycleStateRetType) { + ret, _ = o.GetLifecycleStateOk() + return ret } // GetLifecycleStateOk returns a tuple with the LifecycleState field value // and a boolean to check if the value has been set. -func (o *OrganizationResponse) GetLifecycleStateOk() (*LifecycleState, bool) { - if o == nil { - return nil, false - } - return o.LifecycleState, true +func (o *OrganizationResponse) GetLifecycleStateOk() (ret OrganizationResponseGetLifecycleStateRetType, ok bool) { + return getOrganizationResponseGetLifecycleStateAttributeTypeOk(o.LifecycleState) } // SetLifecycleState sets field value -func (o *OrganizationResponse) SetLifecycleState(v *LifecycleState) { - o.LifecycleState = v +func (o *OrganizationResponse) SetLifecycleState(v OrganizationResponseGetLifecycleStateRetType) { + setOrganizationResponseGetLifecycleStateAttributeType(&o.LifecycleState, v) } // GetName returns the Name field value -func (o *OrganizationResponse) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *OrganizationResponse) GetName() (ret OrganizationResponseGetNameRetType) { + 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 *OrganizationResponse) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *OrganizationResponse) GetNameOk() (ret OrganizationResponseGetNameRetType, ok bool) { + return getOrganizationResponseGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *OrganizationResponse) SetName(v *string) { - o.Name = v +func (o *OrganizationResponse) SetName(v OrganizationResponseGetNameRetType) { + setOrganizationResponseGetNameAttributeType(&o.Name, v) } // GetOrganizationId returns the OrganizationId field value -func (o *OrganizationResponse) GetOrganizationId() *string { - if o == nil || IsNil(o.OrganizationId) { - var ret *string - return ret - } - - return o.OrganizationId +func (o *OrganizationResponse) GetOrganizationId() (ret OrganizationResponseGetOrganizationIdRetType) { + ret, _ = o.GetOrganizationIdOk() + return ret } // GetOrganizationIdOk returns a tuple with the OrganizationId field value // and a boolean to check if the value has been set. -func (o *OrganizationResponse) GetOrganizationIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.OrganizationId, true +func (o *OrganizationResponse) GetOrganizationIdOk() (ret OrganizationResponseGetOrganizationIdRetType, ok bool) { + return getOrganizationResponseGetOrganizationIdAttributeTypeOk(o.OrganizationId) } // SetOrganizationId sets field value -func (o *OrganizationResponse) SetOrganizationId(v *string) { - o.OrganizationId = v +func (o *OrganizationResponse) SetOrganizationId(v OrganizationResponseGetOrganizationIdRetType) { + setOrganizationResponseGetOrganizationIdAttributeType(&o.OrganizationId, v) } // GetUpdateTime returns the UpdateTime field value -func (o *OrganizationResponse) GetUpdateTime() *time.Time { - if o == nil || IsNil(o.UpdateTime) { - var ret *time.Time - return ret - } - - return o.UpdateTime +func (o *OrganizationResponse) GetUpdateTime() (ret OrganizationResponseGetUpdateTimeRetType) { + ret, _ = o.GetUpdateTimeOk() + return ret } // GetUpdateTimeOk returns a tuple with the UpdateTime field value // and a boolean to check if the value has been set. -func (o *OrganizationResponse) GetUpdateTimeOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.UpdateTime, true +func (o *OrganizationResponse) GetUpdateTimeOk() (ret OrganizationResponseGetUpdateTimeRetType, ok bool) { + return getOrganizationResponseGetUpdateTimeAttributeTypeOk(o.UpdateTime) } // SetUpdateTime sets field value -func (o *OrganizationResponse) SetUpdateTime(v *time.Time) { - o.UpdateTime = v +func (o *OrganizationResponse) SetUpdateTime(v OrganizationResponseGetUpdateTimeRetType) { + setOrganizationResponseGetUpdateTimeAttributeType(&o.UpdateTime, v) } func (o OrganizationResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["containerId"] = o.ContainerId - toSerialize["creationTime"] = o.CreationTime - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getOrganizationResponseGetContainerIdAttributeTypeOk(o.ContainerId); ok { + toSerialize["ContainerId"] = val + } + if val, ok := getOrganizationResponseGetCreationTimeAttributeTypeOk(o.CreationTime); ok { + toSerialize["CreationTime"] = val + } + if val, ok := getOrganizationResponseGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getOrganizationResponseGetLifecycleStateAttributeTypeOk(o.LifecycleState); ok { + toSerialize["LifecycleState"] = val + } + if val, ok := getOrganizationResponseGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getOrganizationResponseGetOrganizationIdAttributeTypeOk(o.OrganizationId); ok { + toSerialize["OrganizationId"] = val + } + if val, ok := getOrganizationResponseGetUpdateTimeAttributeTypeOk(o.UpdateTime); ok { + toSerialize["UpdateTime"] = val } - toSerialize["lifecycleState"] = o.LifecycleState - toSerialize["name"] = o.Name - toSerialize["organizationId"] = o.OrganizationId - toSerialize["updateTime"] = o.UpdateTime return toSerialize, nil } diff --git a/services/resourcemanager/model_parent.go b/services/resourcemanager/model_parent.go index 36dfb0deb..a6b63c802 100644 --- a/services/resourcemanager/model_parent.go +++ b/services/resourcemanager/model_parent.go @@ -17,17 +17,79 @@ import ( // checks if the Parent type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Parent{} +/* + types and functions for containerId +*/ + +// isNotNullableString +type ParentGetContainerIdAttributeType = *string + +func getParentGetContainerIdAttributeTypeOk(arg ParentGetContainerIdAttributeType) (ret ParentGetContainerIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setParentGetContainerIdAttributeType(arg *ParentGetContainerIdAttributeType, val ParentGetContainerIdRetType) { + *arg = &val +} + +type ParentGetContainerIdArgType = string +type ParentGetContainerIdRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type ParentGetIdAttributeType = *string + +func getParentGetIdAttributeTypeOk(arg ParentGetIdAttributeType) (ret ParentGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setParentGetIdAttributeType(arg *ParentGetIdAttributeType, val ParentGetIdRetType) { + *arg = &val +} + +type ParentGetIdArgType = string +type ParentGetIdRetType = string + +/* + types and functions for type +*/ + +// isEnumRef +type ParentGetTypeAttributeType = *string +type ParentGetTypeArgType = string +type ParentGetTypeRetType = string + +func getParentGetTypeAttributeTypeOk(arg ParentGetTypeAttributeType) (ret ParentGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setParentGetTypeAttributeType(arg *ParentGetTypeAttributeType, val ParentGetTypeRetType) { + *arg = &val +} + // Parent Parent container. type Parent struct { // User-friendly identifier of either organization or folder (will replace id). // REQUIRED - ContainerId *string `json:"containerId"` + ContainerId ParentGetContainerIdAttributeType `json:"containerId"` // Identifier of either organization or folder. // REQUIRED - Id *string `json:"id"` + Id ParentGetIdAttributeType `json:"id"` // Container type of parent container. // REQUIRED - Type *string `json:"type"` + Type ParentGetTypeAttributeType `json:"type"` } type _Parent Parent @@ -36,11 +98,11 @@ type _Parent Parent // 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 NewParent(containerId *string, id *string, type_ *string) *Parent { +func NewParent(containerId ParentGetContainerIdArgType, id ParentGetIdArgType, type_ ParentGetTypeArgType) *Parent { this := Parent{} - this.ContainerId = containerId - this.Id = id - this.Type = type_ + setParentGetContainerIdAttributeType(&this.ContainerId, containerId) + setParentGetIdAttributeType(&this.Id, id) + setParentGetTypeAttributeType(&this.Type, type_) return &this } @@ -53,82 +115,67 @@ func NewParentWithDefaults() *Parent { } // GetContainerId returns the ContainerId field value -func (o *Parent) GetContainerId() *string { - if o == nil || IsNil(o.ContainerId) { - var ret *string - return ret - } - - return o.ContainerId +func (o *Parent) GetContainerId() (ret ParentGetContainerIdRetType) { + ret, _ = o.GetContainerIdOk() + return ret } // GetContainerIdOk returns a tuple with the ContainerId field value // and a boolean to check if the value has been set. -func (o *Parent) GetContainerIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ContainerId, true +func (o *Parent) GetContainerIdOk() (ret ParentGetContainerIdRetType, ok bool) { + return getParentGetContainerIdAttributeTypeOk(o.ContainerId) } // SetContainerId sets field value -func (o *Parent) SetContainerId(v *string) { - o.ContainerId = v +func (o *Parent) SetContainerId(v ParentGetContainerIdRetType) { + setParentGetContainerIdAttributeType(&o.ContainerId, v) } // GetId returns the Id field value -func (o *Parent) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - - return o.Id +func (o *Parent) GetId() (ret ParentGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *Parent) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *Parent) GetIdOk() (ret ParentGetIdRetType, ok bool) { + return getParentGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *Parent) SetId(v *string) { - o.Id = v +func (o *Parent) SetId(v ParentGetIdRetType) { + setParentGetIdAttributeType(&o.Id, v) } // GetType returns the Type field value -func (o *Parent) GetType() *string { - if o == nil || IsNil(o.Type) { - var ret *string - return ret - } - - return o.Type +func (o *Parent) GetType() (ret ParentGetTypeRetType) { + 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 *Parent) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Type, true +func (o *Parent) GetTypeOk() (ret ParentGetTypeRetType, ok bool) { + return getParentGetTypeAttributeTypeOk(o.Type) } // SetType sets field value -func (o *Parent) SetType(v *string) { - o.Type = v +func (o *Parent) SetType(v ParentGetTypeRetType) { + setParentGetTypeAttributeType(&o.Type, v) } func (o Parent) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["containerId"] = o.ContainerId - toSerialize["id"] = o.Id - toSerialize["type"] = o.Type + if val, ok := getParentGetContainerIdAttributeTypeOk(o.ContainerId); ok { + toSerialize["ContainerId"] = val + } + if val, ok := getParentGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getParentGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } return toSerialize, nil } diff --git a/services/resourcemanager/model_parent_list_inner.go b/services/resourcemanager/model_parent_list_inner.go index cd7cef21c..3a10231d9 100644 --- a/services/resourcemanager/model_parent_list_inner.go +++ b/services/resourcemanager/model_parent_list_inner.go @@ -17,26 +17,151 @@ import ( // checks if the ParentListInner type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ParentListInner{} +/* + types and functions for containerId +*/ + +// isNotNullableString +type ParentListInnerGetContainerIdAttributeType = *string + +func getParentListInnerGetContainerIdAttributeTypeOk(arg ParentListInnerGetContainerIdAttributeType) (ret ParentListInnerGetContainerIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setParentListInnerGetContainerIdAttributeType(arg *ParentListInnerGetContainerIdAttributeType, val ParentListInnerGetContainerIdRetType) { + *arg = &val +} + +type ParentListInnerGetContainerIdArgType = string +type ParentListInnerGetContainerIdRetType = string + +/* + types and functions for containerParentId +*/ + +// isNotNullableString +type ParentListInnerGetContainerParentIdAttributeType = *string + +func getParentListInnerGetContainerParentIdAttributeTypeOk(arg ParentListInnerGetContainerParentIdAttributeType) (ret ParentListInnerGetContainerParentIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setParentListInnerGetContainerParentIdAttributeType(arg *ParentListInnerGetContainerParentIdAttributeType, val ParentListInnerGetContainerParentIdRetType) { + *arg = &val +} + +type ParentListInnerGetContainerParentIdArgType = string +type ParentListInnerGetContainerParentIdRetType = string + +/* + types and functions for id +*/ + +// isNotNullableString +type ParentListInnerGetIdAttributeType = *string + +func getParentListInnerGetIdAttributeTypeOk(arg ParentListInnerGetIdAttributeType) (ret ParentListInnerGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setParentListInnerGetIdAttributeType(arg *ParentListInnerGetIdAttributeType, val ParentListInnerGetIdRetType) { + *arg = &val +} + +type ParentListInnerGetIdArgType = string +type ParentListInnerGetIdRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type ParentListInnerGetNameAttributeType = *string + +func getParentListInnerGetNameAttributeTypeOk(arg ParentListInnerGetNameAttributeType) (ret ParentListInnerGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setParentListInnerGetNameAttributeType(arg *ParentListInnerGetNameAttributeType, val ParentListInnerGetNameRetType) { + *arg = &val +} + +type ParentListInnerGetNameArgType = string +type ParentListInnerGetNameRetType = string + +/* + types and functions for parentId +*/ + +// isNotNullableString +type ParentListInnerGetParentIdAttributeType = *string + +func getParentListInnerGetParentIdAttributeTypeOk(arg ParentListInnerGetParentIdAttributeType) (ret ParentListInnerGetParentIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setParentListInnerGetParentIdAttributeType(arg *ParentListInnerGetParentIdAttributeType, val ParentListInnerGetParentIdRetType) { + *arg = &val +} + +type ParentListInnerGetParentIdArgType = string +type ParentListInnerGetParentIdRetType = string + +/* + types and functions for type +*/ + +// isEnumRef +type ParentListInnerGetTypeAttributeType = *string +type ParentListInnerGetTypeArgType = string +type ParentListInnerGetTypeRetType = string + +func getParentListInnerGetTypeAttributeTypeOk(arg ParentListInnerGetTypeAttributeType) (ret ParentListInnerGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setParentListInnerGetTypeAttributeType(arg *ParentListInnerGetTypeAttributeType, val ParentListInnerGetTypeRetType) { + *arg = &val +} + // ParentListInner struct for ParentListInner type ParentListInner struct { // User-friendly identifier of either organization or folder (will replace id). // REQUIRED - ContainerId *string `json:"containerId"` + ContainerId ParentListInnerGetContainerIdAttributeType `json:"containerId"` // User-friendly parent identifier of either organization or folder (will replace parentId). // REQUIRED - ContainerParentId *string `json:"containerParentId"` + ContainerParentId ParentListInnerGetContainerParentIdAttributeType `json:"containerParentId"` // Identifier. // REQUIRED - Id *string `json:"id"` + Id ParentListInnerGetIdAttributeType `json:"id"` // Parent container name. // REQUIRED - Name *string `json:"name"` + Name ParentListInnerGetNameAttributeType `json:"name"` // Identifier of the parent resource container. // REQUIRED - ParentId *string `json:"parentId"` + ParentId ParentListInnerGetParentIdAttributeType `json:"parentId"` // Parent container type. // REQUIRED - Type *string `json:"type"` + Type ParentListInnerGetTypeAttributeType `json:"type"` } type _ParentListInner ParentListInner @@ -45,14 +170,14 @@ type _ParentListInner ParentListInner // 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 NewParentListInner(containerId *string, containerParentId *string, id *string, name *string, parentId *string, type_ *string) *ParentListInner { +func NewParentListInner(containerId ParentListInnerGetContainerIdArgType, containerParentId ParentListInnerGetContainerParentIdArgType, id ParentListInnerGetIdArgType, name ParentListInnerGetNameArgType, parentId ParentListInnerGetParentIdArgType, type_ ParentListInnerGetTypeArgType) *ParentListInner { this := ParentListInner{} - this.ContainerId = containerId - this.ContainerParentId = containerParentId - this.Id = id - this.Name = name - this.ParentId = parentId - this.Type = type_ + setParentListInnerGetContainerIdAttributeType(&this.ContainerId, containerId) + setParentListInnerGetContainerParentIdAttributeType(&this.ContainerParentId, containerParentId) + setParentListInnerGetIdAttributeType(&this.Id, id) + setParentListInnerGetNameAttributeType(&this.Name, name) + setParentListInnerGetParentIdAttributeType(&this.ParentId, parentId) + setParentListInnerGetTypeAttributeType(&this.Type, type_) return &this } @@ -65,157 +190,127 @@ func NewParentListInnerWithDefaults() *ParentListInner { } // GetContainerId returns the ContainerId field value -func (o *ParentListInner) GetContainerId() *string { - if o == nil || IsNil(o.ContainerId) { - var ret *string - return ret - } - - return o.ContainerId +func (o *ParentListInner) GetContainerId() (ret ParentListInnerGetContainerIdRetType) { + ret, _ = o.GetContainerIdOk() + return ret } // GetContainerIdOk returns a tuple with the ContainerId field value // and a boolean to check if the value has been set. -func (o *ParentListInner) GetContainerIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ContainerId, true +func (o *ParentListInner) GetContainerIdOk() (ret ParentListInnerGetContainerIdRetType, ok bool) { + return getParentListInnerGetContainerIdAttributeTypeOk(o.ContainerId) } // SetContainerId sets field value -func (o *ParentListInner) SetContainerId(v *string) { - o.ContainerId = v +func (o *ParentListInner) SetContainerId(v ParentListInnerGetContainerIdRetType) { + setParentListInnerGetContainerIdAttributeType(&o.ContainerId, v) } // GetContainerParentId returns the ContainerParentId field value -func (o *ParentListInner) GetContainerParentId() *string { - if o == nil || IsNil(o.ContainerParentId) { - var ret *string - return ret - } - - return o.ContainerParentId +func (o *ParentListInner) GetContainerParentId() (ret ParentListInnerGetContainerParentIdRetType) { + ret, _ = o.GetContainerParentIdOk() + return ret } // GetContainerParentIdOk returns a tuple with the ContainerParentId field value // and a boolean to check if the value has been set. -func (o *ParentListInner) GetContainerParentIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ContainerParentId, true +func (o *ParentListInner) GetContainerParentIdOk() (ret ParentListInnerGetContainerParentIdRetType, ok bool) { + return getParentListInnerGetContainerParentIdAttributeTypeOk(o.ContainerParentId) } // SetContainerParentId sets field value -func (o *ParentListInner) SetContainerParentId(v *string) { - o.ContainerParentId = v +func (o *ParentListInner) SetContainerParentId(v ParentListInnerGetContainerParentIdRetType) { + setParentListInnerGetContainerParentIdAttributeType(&o.ContainerParentId, v) } // GetId returns the Id field value -func (o *ParentListInner) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - - return o.Id +func (o *ParentListInner) GetId() (ret ParentListInnerGetIdRetType) { + ret, _ = o.GetIdOk() + return ret } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *ParentListInner) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Id, true +func (o *ParentListInner) GetIdOk() (ret ParentListInnerGetIdRetType, ok bool) { + return getParentListInnerGetIdAttributeTypeOk(o.Id) } // SetId sets field value -func (o *ParentListInner) SetId(v *string) { - o.Id = v +func (o *ParentListInner) SetId(v ParentListInnerGetIdRetType) { + setParentListInnerGetIdAttributeType(&o.Id, v) } // GetName returns the Name field value -func (o *ParentListInner) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *ParentListInner) GetName() (ret ParentListInnerGetNameRetType) { + 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 *ParentListInner) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *ParentListInner) GetNameOk() (ret ParentListInnerGetNameRetType, ok bool) { + return getParentListInnerGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *ParentListInner) SetName(v *string) { - o.Name = v +func (o *ParentListInner) SetName(v ParentListInnerGetNameRetType) { + setParentListInnerGetNameAttributeType(&o.Name, v) } // GetParentId returns the ParentId field value -func (o *ParentListInner) GetParentId() *string { - if o == nil || IsNil(o.ParentId) { - var ret *string - return ret - } - - return o.ParentId +func (o *ParentListInner) GetParentId() (ret ParentListInnerGetParentIdRetType) { + ret, _ = o.GetParentIdOk() + return ret } // GetParentIdOk returns a tuple with the ParentId field value // and a boolean to check if the value has been set. -func (o *ParentListInner) GetParentIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ParentId, true +func (o *ParentListInner) GetParentIdOk() (ret ParentListInnerGetParentIdRetType, ok bool) { + return getParentListInnerGetParentIdAttributeTypeOk(o.ParentId) } // SetParentId sets field value -func (o *ParentListInner) SetParentId(v *string) { - o.ParentId = v +func (o *ParentListInner) SetParentId(v ParentListInnerGetParentIdRetType) { + setParentListInnerGetParentIdAttributeType(&o.ParentId, v) } // GetType returns the Type field value -func (o *ParentListInner) GetType() *string { - if o == nil || IsNil(o.Type) { - var ret *string - return ret - } - - return o.Type +func (o *ParentListInner) GetType() (ret ParentListInnerGetTypeRetType) { + 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 *ParentListInner) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Type, true +func (o *ParentListInner) GetTypeOk() (ret ParentListInnerGetTypeRetType, ok bool) { + return getParentListInnerGetTypeAttributeTypeOk(o.Type) } // SetType sets field value -func (o *ParentListInner) SetType(v *string) { - o.Type = v +func (o *ParentListInner) SetType(v ParentListInnerGetTypeRetType) { + setParentListInnerGetTypeAttributeType(&o.Type, v) } func (o ParentListInner) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["containerId"] = o.ContainerId - toSerialize["containerParentId"] = o.ContainerParentId - toSerialize["id"] = o.Id - toSerialize["name"] = o.Name - toSerialize["parentId"] = o.ParentId - toSerialize["type"] = o.Type + if val, ok := getParentListInnerGetContainerIdAttributeTypeOk(o.ContainerId); ok { + toSerialize["ContainerId"] = val + } + if val, ok := getParentListInnerGetContainerParentIdAttributeTypeOk(o.ContainerParentId); ok { + toSerialize["ContainerParentId"] = val + } + if val, ok := getParentListInnerGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getParentListInnerGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getParentListInnerGetParentIdAttributeTypeOk(o.ParentId); ok { + toSerialize["ParentId"] = val + } + if val, ok := getParentListInnerGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val + } return toSerialize, nil } diff --git a/services/resourcemanager/model_partial_update_project_payload.go b/services/resourcemanager/model_partial_update_project_payload.go index e3568fedb..b6d20a81c 100644 --- a/services/resourcemanager/model_partial_update_project_payload.go +++ b/services/resourcemanager/model_partial_update_project_payload.go @@ -17,14 +17,76 @@ import ( // checks if the PartialUpdateProjectPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &PartialUpdateProjectPayload{} +/* + types and functions for containerParentId +*/ + +// isNotNullableString +type PartialUpdateProjectPayloadGetContainerParentIdAttributeType = *string + +func getPartialUpdateProjectPayloadGetContainerParentIdAttributeTypeOk(arg PartialUpdateProjectPayloadGetContainerParentIdAttributeType) (ret PartialUpdateProjectPayloadGetContainerParentIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateProjectPayloadGetContainerParentIdAttributeType(arg *PartialUpdateProjectPayloadGetContainerParentIdAttributeType, val PartialUpdateProjectPayloadGetContainerParentIdRetType) { + *arg = &val +} + +type PartialUpdateProjectPayloadGetContainerParentIdArgType = string +type PartialUpdateProjectPayloadGetContainerParentIdRetType = string + +/* + types and functions for labels +*/ + +// isContainer +type PartialUpdateProjectPayloadGetLabelsAttributeType = *map[string]string +type PartialUpdateProjectPayloadGetLabelsArgType = map[string]string +type PartialUpdateProjectPayloadGetLabelsRetType = map[string]string + +func getPartialUpdateProjectPayloadGetLabelsAttributeTypeOk(arg PartialUpdateProjectPayloadGetLabelsAttributeType) (ret PartialUpdateProjectPayloadGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateProjectPayloadGetLabelsAttributeType(arg *PartialUpdateProjectPayloadGetLabelsAttributeType, val PartialUpdateProjectPayloadGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type PartialUpdateProjectPayloadGetNameAttributeType = *string + +func getPartialUpdateProjectPayloadGetNameAttributeTypeOk(arg PartialUpdateProjectPayloadGetNameAttributeType) (ret PartialUpdateProjectPayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateProjectPayloadGetNameAttributeType(arg *PartialUpdateProjectPayloadGetNameAttributeType, val PartialUpdateProjectPayloadGetNameRetType) { + *arg = &val +} + +type PartialUpdateProjectPayloadGetNameArgType = string +type PartialUpdateProjectPayloadGetNameRetType = string + // PartialUpdateProjectPayload struct for PartialUpdateProjectPayload type PartialUpdateProjectPayload struct { // New parent identifier for the resource container - containerId as well as UUID identifier is supported. - ContainerParentId *string `json:"containerParentId,omitempty"` + ContainerParentId PartialUpdateProjectPayloadGetContainerParentIdAttributeType `json:"containerParentId,omitempty"` // Labels are key-value string pairs that can be attached to a resource container. Some labels may be enforced via policies. - A label key must match the regex `[A-ZÄÜÖa-zäüöß0-9_-]{1,64}`. - A label value must match the regex `^$|[A-ZÄÜÖa-zäüöß0-9_-]{1,64}`. - Labels *map[string]string `json:"labels,omitempty"` + Labels PartialUpdateProjectPayloadGetLabelsAttributeType `json:"labels,omitempty"` // New name for the resource container matching the regex `^[a-zA-ZäüöÄÜÖ0-9]( ?[a-zA-ZäüöÄÜÖß0-9_+&-]){0,39}$`. - Name *string `json:"name,omitempty"` + Name PartialUpdateProjectPayloadGetNameAttributeType `json:"name,omitempty"` } // NewPartialUpdateProjectPayload instantiates a new PartialUpdateProjectPayload object @@ -45,111 +107,84 @@ func NewPartialUpdateProjectPayloadWithDefaults() *PartialUpdateProjectPayload { } // GetContainerParentId returns the ContainerParentId field value if set, zero value otherwise. -func (o *PartialUpdateProjectPayload) GetContainerParentId() *string { - if o == nil || IsNil(o.ContainerParentId) { - var ret *string - return ret - } - return o.ContainerParentId +func (o *PartialUpdateProjectPayload) GetContainerParentId() (res PartialUpdateProjectPayloadGetContainerParentIdRetType) { + res, _ = o.GetContainerParentIdOk() + return } // GetContainerParentIdOk returns a tuple with the ContainerParentId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PartialUpdateProjectPayload) GetContainerParentIdOk() (*string, bool) { - if o == nil || IsNil(o.ContainerParentId) { - return nil, false - } - return o.ContainerParentId, true +func (o *PartialUpdateProjectPayload) GetContainerParentIdOk() (ret PartialUpdateProjectPayloadGetContainerParentIdRetType, ok bool) { + return getPartialUpdateProjectPayloadGetContainerParentIdAttributeTypeOk(o.ContainerParentId) } // HasContainerParentId returns a boolean if a field has been set. func (o *PartialUpdateProjectPayload) HasContainerParentId() bool { - if o != nil && !IsNil(o.ContainerParentId) { - return true - } - - return false + _, ok := o.GetContainerParentIdOk() + return ok } // SetContainerParentId gets a reference to the given string and assigns it to the ContainerParentId field. -func (o *PartialUpdateProjectPayload) SetContainerParentId(v *string) { - o.ContainerParentId = v +func (o *PartialUpdateProjectPayload) SetContainerParentId(v PartialUpdateProjectPayloadGetContainerParentIdRetType) { + setPartialUpdateProjectPayloadGetContainerParentIdAttributeType(&o.ContainerParentId, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *PartialUpdateProjectPayload) GetLabels() *map[string]string { - if o == nil || IsNil(o.Labels) { - var ret *map[string]string - return ret - } - return o.Labels +func (o *PartialUpdateProjectPayload) GetLabels() (res PartialUpdateProjectPayloadGetLabelsRetType) { + 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 *PartialUpdateProjectPayload) GetLabelsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Labels) { - return nil, false - } - return o.Labels, true +func (o *PartialUpdateProjectPayload) GetLabelsOk() (ret PartialUpdateProjectPayloadGetLabelsRetType, ok bool) { + return getPartialUpdateProjectPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *PartialUpdateProjectPayload) 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 *PartialUpdateProjectPayload) SetLabels(v *map[string]string) { - o.Labels = v +func (o *PartialUpdateProjectPayload) SetLabels(v PartialUpdateProjectPayloadGetLabelsRetType) { + setPartialUpdateProjectPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *PartialUpdateProjectPayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *PartialUpdateProjectPayload) GetName() (res PartialUpdateProjectPayloadGetNameRetType) { + 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 *PartialUpdateProjectPayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *PartialUpdateProjectPayload) GetNameOk() (ret PartialUpdateProjectPayloadGetNameRetType, ok bool) { + return getPartialUpdateProjectPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *PartialUpdateProjectPayload) 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 *PartialUpdateProjectPayload) SetName(v *string) { - o.Name = v +func (o *PartialUpdateProjectPayload) SetName(v PartialUpdateProjectPayloadGetNameRetType) { + setPartialUpdateProjectPayloadGetNameAttributeType(&o.Name, v) } func (o PartialUpdateProjectPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.ContainerParentId) { - toSerialize["containerParentId"] = o.ContainerParentId + if val, ok := getPartialUpdateProjectPayloadGetContainerParentIdAttributeTypeOk(o.ContainerParentId); ok { + toSerialize["ContainerParentId"] = val } - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getPartialUpdateProjectPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getPartialUpdateProjectPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } return toSerialize, nil } diff --git a/services/resourcemanager/model_project.go b/services/resourcemanager/model_project.go index 5bc64349e..ae99f0037 100644 --- a/services/resourcemanager/model_project.go +++ b/services/resourcemanager/model_project.go @@ -18,29 +18,192 @@ import ( // checks if the Project type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Project{} +/* + types and functions for containerId +*/ + +// isNotNullableString +type ProjectGetContainerIdAttributeType = *string + +func getProjectGetContainerIdAttributeTypeOk(arg ProjectGetContainerIdAttributeType) (ret ProjectGetContainerIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setProjectGetContainerIdAttributeType(arg *ProjectGetContainerIdAttributeType, val ProjectGetContainerIdRetType) { + *arg = &val +} + +type ProjectGetContainerIdArgType = string +type ProjectGetContainerIdRetType = string + +/* + types and functions for creationTime +*/ + +// isDateTime +type ProjectGetCreationTimeAttributeType = *time.Time +type ProjectGetCreationTimeArgType = time.Time +type ProjectGetCreationTimeRetType = time.Time + +func getProjectGetCreationTimeAttributeTypeOk(arg ProjectGetCreationTimeAttributeType) (ret ProjectGetCreationTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setProjectGetCreationTimeAttributeType(arg *ProjectGetCreationTimeAttributeType, val ProjectGetCreationTimeRetType) { + *arg = &val +} + +/* + types and functions for labels +*/ + +// isContainer +type ProjectGetLabelsAttributeType = *map[string]string +type ProjectGetLabelsArgType = map[string]string +type ProjectGetLabelsRetType = map[string]string + +func getProjectGetLabelsAttributeTypeOk(arg ProjectGetLabelsAttributeType) (ret ProjectGetLabelsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setProjectGetLabelsAttributeType(arg *ProjectGetLabelsAttributeType, val ProjectGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for lifecycleState +*/ + +// isEnumRef +type ProjectGetLifecycleStateAttributeType = *LifecycleState +type ProjectGetLifecycleStateArgType = LifecycleState +type ProjectGetLifecycleStateRetType = LifecycleState + +func getProjectGetLifecycleStateAttributeTypeOk(arg ProjectGetLifecycleStateAttributeType) (ret ProjectGetLifecycleStateRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setProjectGetLifecycleStateAttributeType(arg *ProjectGetLifecycleStateAttributeType, val ProjectGetLifecycleStateRetType) { + *arg = &val +} + +/* + types and functions for name +*/ + +// isNotNullableString +type ProjectGetNameAttributeType = *string + +func getProjectGetNameAttributeTypeOk(arg ProjectGetNameAttributeType) (ret ProjectGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setProjectGetNameAttributeType(arg *ProjectGetNameAttributeType, val ProjectGetNameRetType) { + *arg = &val +} + +type ProjectGetNameArgType = string +type ProjectGetNameRetType = string + +/* + types and functions for parent +*/ + +// isModel +type ProjectGetParentAttributeType = *Parent +type ProjectGetParentArgType = Parent +type ProjectGetParentRetType = Parent + +func getProjectGetParentAttributeTypeOk(arg ProjectGetParentAttributeType) (ret ProjectGetParentRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setProjectGetParentAttributeType(arg *ProjectGetParentAttributeType, val ProjectGetParentRetType) { + *arg = &val +} + +/* + types and functions for projectId +*/ + +// isNotNullableString +type ProjectGetProjectIdAttributeType = *string + +func getProjectGetProjectIdAttributeTypeOk(arg ProjectGetProjectIdAttributeType) (ret ProjectGetProjectIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setProjectGetProjectIdAttributeType(arg *ProjectGetProjectIdAttributeType, val ProjectGetProjectIdRetType) { + *arg = &val +} + +type ProjectGetProjectIdArgType = string +type ProjectGetProjectIdRetType = string + +/* + types and functions for updateTime +*/ + +// isDateTime +type ProjectGetUpdateTimeAttributeType = *time.Time +type ProjectGetUpdateTimeArgType = time.Time +type ProjectGetUpdateTimeRetType = time.Time + +func getProjectGetUpdateTimeAttributeTypeOk(arg ProjectGetUpdateTimeAttributeType) (ret ProjectGetUpdateTimeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setProjectGetUpdateTimeAttributeType(arg *ProjectGetUpdateTimeAttributeType, val ProjectGetUpdateTimeRetType) { + *arg = &val +} + // Project struct for Project type Project struct { // Globally unique, user-friendly identifier. // REQUIRED - ContainerId *string `json:"containerId"` + ContainerId ProjectGetContainerIdAttributeType `json:"containerId"` // Timestamp at which the project was created. // REQUIRED - CreationTime *time.Time `json:"creationTime"` + CreationTime ProjectGetCreationTimeAttributeType `json:"creationTime"` // Labels are key-value string pairs that can be attached to a resource container. Some labels may be enforced via policies. - A label key must match the regex `[A-ZÄÜÖa-zäüöß0-9_-]{1,64}`. - A label value must match the regex `^$|[A-ZÄÜÖa-zäüöß0-9_-]{1,64}`. - Labels *map[string]string `json:"labels,omitempty"` + Labels ProjectGetLabelsAttributeType `json:"labels,omitempty"` // REQUIRED - LifecycleState *LifecycleState `json:"lifecycleState"` + LifecycleState ProjectGetLifecycleStateAttributeType `json:"lifecycleState"` // Project name. // REQUIRED - Name *string `json:"name"` + Name ProjectGetNameAttributeType `json:"name"` // REQUIRED - Parent *Parent `json:"parent"` + Parent ProjectGetParentAttributeType `json:"parent"` // Globally unique, project identifier. // REQUIRED - ProjectId *string `json:"projectId"` + ProjectId ProjectGetProjectIdAttributeType `json:"projectId"` // Timestamp at which the project was last modified. // REQUIRED - UpdateTime *time.Time `json:"updateTime"` + UpdateTime ProjectGetUpdateTimeAttributeType `json:"updateTime"` } type _Project Project @@ -49,15 +212,15 @@ type _Project Project // 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 NewProject(containerId *string, creationTime *time.Time, lifecycleState *LifecycleState, name *string, parent *Parent, projectId *string, updateTime *time.Time) *Project { +func NewProject(containerId ProjectGetContainerIdArgType, creationTime ProjectGetCreationTimeArgType, lifecycleState ProjectGetLifecycleStateArgType, name ProjectGetNameArgType, parent ProjectGetParentArgType, projectId ProjectGetProjectIdArgType, updateTime ProjectGetUpdateTimeArgType) *Project { this := Project{} - this.ContainerId = containerId - this.CreationTime = creationTime - this.LifecycleState = lifecycleState - this.Name = name - this.Parent = parent - this.ProjectId = projectId - this.UpdateTime = updateTime + setProjectGetContainerIdAttributeType(&this.ContainerId, containerId) + setProjectGetCreationTimeAttributeType(&this.CreationTime, creationTime) + setProjectGetLifecycleStateAttributeType(&this.LifecycleState, lifecycleState) + setProjectGetNameAttributeType(&this.Name, name) + setProjectGetParentAttributeType(&this.Parent, parent) + setProjectGetProjectIdAttributeType(&this.ProjectId, projectId) + setProjectGetUpdateTimeAttributeType(&this.UpdateTime, updateTime) return &this } @@ -70,217 +233,173 @@ func NewProjectWithDefaults() *Project { } // GetContainerId returns the ContainerId field value -func (o *Project) GetContainerId() *string { - if o == nil || IsNil(o.ContainerId) { - var ret *string - return ret - } - - return o.ContainerId +func (o *Project) GetContainerId() (ret ProjectGetContainerIdRetType) { + ret, _ = o.GetContainerIdOk() + return ret } // GetContainerIdOk returns a tuple with the ContainerId field value // and a boolean to check if the value has been set. -func (o *Project) GetContainerIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ContainerId, true +func (o *Project) GetContainerIdOk() (ret ProjectGetContainerIdRetType, ok bool) { + return getProjectGetContainerIdAttributeTypeOk(o.ContainerId) } // SetContainerId sets field value -func (o *Project) SetContainerId(v *string) { - o.ContainerId = v +func (o *Project) SetContainerId(v ProjectGetContainerIdRetType) { + setProjectGetContainerIdAttributeType(&o.ContainerId, v) } // GetCreationTime returns the CreationTime field value -func (o *Project) GetCreationTime() *time.Time { - if o == nil || IsNil(o.CreationTime) { - var ret *time.Time - return ret - } - - return o.CreationTime +func (o *Project) GetCreationTime() (ret ProjectGetCreationTimeRetType) { + ret, _ = o.GetCreationTimeOk() + return ret } // GetCreationTimeOk returns a tuple with the CreationTime field value // and a boolean to check if the value has been set. -func (o *Project) GetCreationTimeOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.CreationTime, true +func (o *Project) GetCreationTimeOk() (ret ProjectGetCreationTimeRetType, ok bool) { + return getProjectGetCreationTimeAttributeTypeOk(o.CreationTime) } // SetCreationTime sets field value -func (o *Project) SetCreationTime(v *time.Time) { - o.CreationTime = v +func (o *Project) SetCreationTime(v ProjectGetCreationTimeRetType) { + setProjectGetCreationTimeAttributeType(&o.CreationTime, v) } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *Project) GetLabels() *map[string]string { - if o == nil || IsNil(o.Labels) { - var ret *map[string]string - return ret - } - return o.Labels +func (o *Project) GetLabels() (res ProjectGetLabelsRetType) { + 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 *Project) GetLabelsOk() (*map[string]string, bool) { - if o == nil || IsNil(o.Labels) { - return nil, false - } - return o.Labels, true +func (o *Project) GetLabelsOk() (ret ProjectGetLabelsRetType, ok bool) { + return getProjectGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *Project) 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 *Project) SetLabels(v *map[string]string) { - o.Labels = v +func (o *Project) SetLabels(v ProjectGetLabelsRetType) { + setProjectGetLabelsAttributeType(&o.Labels, v) } // GetLifecycleState returns the LifecycleState field value -func (o *Project) GetLifecycleState() *LifecycleState { - if o == nil || IsNil(o.LifecycleState) { - var ret *LifecycleState - return ret - } - - return o.LifecycleState +func (o *Project) GetLifecycleState() (ret ProjectGetLifecycleStateRetType) { + ret, _ = o.GetLifecycleStateOk() + return ret } // GetLifecycleStateOk returns a tuple with the LifecycleState field value // and a boolean to check if the value has been set. -func (o *Project) GetLifecycleStateOk() (*LifecycleState, bool) { - if o == nil { - return nil, false - } - return o.LifecycleState, true +func (o *Project) GetLifecycleStateOk() (ret ProjectGetLifecycleStateRetType, ok bool) { + return getProjectGetLifecycleStateAttributeTypeOk(o.LifecycleState) } // SetLifecycleState sets field value -func (o *Project) SetLifecycleState(v *LifecycleState) { - o.LifecycleState = v +func (o *Project) SetLifecycleState(v ProjectGetLifecycleStateRetType) { + setProjectGetLifecycleStateAttributeType(&o.LifecycleState, v) } // GetName returns the Name field value -func (o *Project) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - - return o.Name +func (o *Project) GetName() (ret ProjectGetNameRetType) { + 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 *Project) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Name, true +func (o *Project) GetNameOk() (ret ProjectGetNameRetType, ok bool) { + return getProjectGetNameAttributeTypeOk(o.Name) } // SetName sets field value -func (o *Project) SetName(v *string) { - o.Name = v +func (o *Project) SetName(v ProjectGetNameRetType) { + setProjectGetNameAttributeType(&o.Name, v) } // GetParent returns the Parent field value -func (o *Project) GetParent() *Parent { - if o == nil || IsNil(o.Parent) { - var ret *Parent - return ret - } - - return o.Parent +func (o *Project) GetParent() (ret ProjectGetParentRetType) { + ret, _ = o.GetParentOk() + return ret } // GetParentOk returns a tuple with the Parent field value // and a boolean to check if the value has been set. -func (o *Project) GetParentOk() (*Parent, bool) { - if o == nil { - return nil, false - } - return o.Parent, true +func (o *Project) GetParentOk() (ret ProjectGetParentRetType, ok bool) { + return getProjectGetParentAttributeTypeOk(o.Parent) } // SetParent sets field value -func (o *Project) SetParent(v *Parent) { - o.Parent = v +func (o *Project) SetParent(v ProjectGetParentRetType) { + setProjectGetParentAttributeType(&o.Parent, v) } // GetProjectId returns the ProjectId field value -func (o *Project) GetProjectId() *string { - if o == nil || IsNil(o.ProjectId) { - var ret *string - return ret - } - - return o.ProjectId +func (o *Project) GetProjectId() (ret ProjectGetProjectIdRetType) { + ret, _ = o.GetProjectIdOk() + return ret } // GetProjectIdOk returns a tuple with the ProjectId field value // and a boolean to check if the value has been set. -func (o *Project) GetProjectIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ProjectId, true +func (o *Project) GetProjectIdOk() (ret ProjectGetProjectIdRetType, ok bool) { + return getProjectGetProjectIdAttributeTypeOk(o.ProjectId) } // SetProjectId sets field value -func (o *Project) SetProjectId(v *string) { - o.ProjectId = v +func (o *Project) SetProjectId(v ProjectGetProjectIdRetType) { + setProjectGetProjectIdAttributeType(&o.ProjectId, v) } // GetUpdateTime returns the UpdateTime field value -func (o *Project) GetUpdateTime() *time.Time { - if o == nil || IsNil(o.UpdateTime) { - var ret *time.Time - return ret - } - - return o.UpdateTime +func (o *Project) GetUpdateTime() (ret ProjectGetUpdateTimeRetType) { + ret, _ = o.GetUpdateTimeOk() + return ret } // GetUpdateTimeOk returns a tuple with the UpdateTime field value // and a boolean to check if the value has been set. -func (o *Project) GetUpdateTimeOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.UpdateTime, true +func (o *Project) GetUpdateTimeOk() (ret ProjectGetUpdateTimeRetType, ok bool) { + return getProjectGetUpdateTimeAttributeTypeOk(o.UpdateTime) } // SetUpdateTime sets field value -func (o *Project) SetUpdateTime(v *time.Time) { - o.UpdateTime = v +func (o *Project) SetUpdateTime(v ProjectGetUpdateTimeRetType) { + setProjectGetUpdateTimeAttributeType(&o.UpdateTime, v) } func (o Project) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["containerId"] = o.ContainerId - toSerialize["creationTime"] = o.CreationTime - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels + if val, ok := getProjectGetContainerIdAttributeTypeOk(o.ContainerId); ok { + toSerialize["ContainerId"] = val + } + if val, ok := getProjectGetCreationTimeAttributeTypeOk(o.CreationTime); ok { + toSerialize["CreationTime"] = val + } + if val, ok := getProjectGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getProjectGetLifecycleStateAttributeTypeOk(o.LifecycleState); ok { + toSerialize["LifecycleState"] = val + } + if val, ok := getProjectGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getProjectGetParentAttributeTypeOk(o.Parent); ok { + toSerialize["Parent"] = val + } + if val, ok := getProjectGetProjectIdAttributeTypeOk(o.ProjectId); ok { + toSerialize["ProjectId"] = val + } + if val, ok := getProjectGetUpdateTimeAttributeTypeOk(o.UpdateTime); ok { + toSerialize["UpdateTime"] = val } - toSerialize["lifecycleState"] = o.LifecycleState - toSerialize["name"] = o.Name - toSerialize["parent"] = o.Parent - toSerialize["projectId"] = o.ProjectId - toSerialize["updateTime"] = o.UpdateTime return toSerialize, nil } diff --git a/services/resourcemanager/utils.go b/services/resourcemanager/utils.go index 50719b075..539d98da2 100644 --- a/services/resourcemanager/utils.go +++ b/services/resourcemanager/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()