From 4f6736c5a1887276205a662e5488eba38e0a884a Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Mon, 23 Jun 2025 11:52:56 +0000 Subject: [PATCH] Generate iaas --- services/iaas/api_default.go | 8 ++-- services/iaas/api_default_test.go | 4 +- services/iaas/model_create_server_payload.go | 48 ++++++++++++++++++++ services/iaas/model_server.go | 48 ++++++++++++++++++++ services/iaas/model_update_server_payload.go | 48 ++++++++++++++++++++ 5 files changed, 150 insertions(+), 6 deletions(-) diff --git a/services/iaas/api_default.go b/services/iaas/api_default.go index e4eb93da2..2e480bbd2 100644 --- a/services/iaas/api_default.go +++ b/services/iaas/api_default.go @@ -11840,8 +11840,8 @@ func (r GetMachineTypeRequest) Execute() (*MachineType, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.machineType) > 63 { - return localVarReturnValue, fmt.Errorf("machineType must have less than 63 elements") + if strlen(r.machineType) > 127 { + return localVarReturnValue, fmt.Errorf("machineType must have less than 127 elements") } // to determine the Content-Type header @@ -15167,8 +15167,8 @@ func (r GetVolumePerformanceClassRequest) Execute() (*VolumePerformanceClass, er if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.volumePerformanceClass) > 63 { - return localVarReturnValue, fmt.Errorf("volumePerformanceClass must have less than 63 elements") + if strlen(r.volumePerformanceClass) > 127 { + return localVarReturnValue, fmt.Errorf("volumePerformanceClass must have less than 127 elements") } // to determine the Content-Type header diff --git a/services/iaas/api_default_test.go b/services/iaas/api_default_test.go index 20f6ce22c..9d7b30959 100644 --- a/services/iaas/api_default_test.go +++ b/services/iaas/api_default_test.go @@ -2437,7 +2437,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { _apiUrlPath := "/v1/projects/{projectId}/machine-types/{machineType}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - machineTypeValue := randString(63) + machineTypeValue := randString(127) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"machineType"+"}", url.PathEscape(ParameterValueToString(machineTypeValue, "machineType")), -1) testDefaultApiServeMux := http.NewServeMux() @@ -3384,7 +3384,7 @@ func Test_iaas_DefaultApiService(t *testing.T) { _apiUrlPath := "/v1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}" projectIdValue := randString(36) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - volumePerformanceClassValue := randString(63) + volumePerformanceClassValue := randString(127) _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"volumePerformanceClass"+"}", url.PathEscape(ParameterValueToString(volumePerformanceClassValue, "volumePerformanceClass")), -1) testDefaultApiServeMux := http.NewServeMux() diff --git a/services/iaas/model_create_server_payload.go b/services/iaas/model_create_server_payload.go index 906982a9d..41c5d3ae5 100644 --- a/services/iaas/model_create_server_payload.go +++ b/services/iaas/model_create_server_payload.go @@ -265,6 +265,26 @@ func setCreateServerPayloadGetMaintenanceWindowAttributeType(arg *CreateServerPa *arg = &val } +/* + types and functions for metadata +*/ + +// isFreeform +type CreateServerPayloadGetMetadataAttributeType = *map[string]interface{} +type CreateServerPayloadGetMetadataArgType = map[string]interface{} +type CreateServerPayloadGetMetadataRetType = map[string]interface{} + +func getCreateServerPayloadGetMetadataAttributeTypeOk(arg CreateServerPayloadGetMetadataAttributeType) (ret CreateServerPayloadGetMetadataRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateServerPayloadGetMetadataAttributeType(arg *CreateServerPayloadGetMetadataAttributeType, val CreateServerPayloadGetMetadataRetType) { + *arg = &val +} + /* types and functions for name */ @@ -493,6 +513,8 @@ type CreateServerPayload struct { // REQUIRED MachineType CreateServerPayloadGetMachineTypeAttributeType `json:"machineType" required:"true"` MaintenanceWindow CreateServerPayloadGetMaintenanceWindowAttributeType `json:"maintenanceWindow,omitempty"` + // Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. + Metadata CreateServerPayloadGetMetadataAttributeType `json:"metadata,omitempty"` // The name for a Server. // REQUIRED Name CreateServerPayloadGetNameAttributeType `json:"name" required:"true"` @@ -806,6 +828,29 @@ func (o *CreateServerPayload) SetMaintenanceWindow(v CreateServerPayloadGetMaint setCreateServerPayloadGetMaintenanceWindowAttributeType(&o.MaintenanceWindow, v) } +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *CreateServerPayload) GetMetadata() (res CreateServerPayloadGetMetadataRetType) { + res, _ = o.GetMetadataOk() + return +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetMetadataOk() (ret CreateServerPayloadGetMetadataRetType, ok bool) { + return getCreateServerPayloadGetMetadataAttributeTypeOk(o.Metadata) +} + +// HasMetadata returns a boolean if a field has been set. +func (o *CreateServerPayload) HasMetadata() bool { + _, ok := o.GetMetadataOk() + return ok +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *CreateServerPayload) SetMetadata(v CreateServerPayloadGetMetadataRetType) { + setCreateServerPayloadGetMetadataAttributeType(&o.Metadata, v) +} + // GetName returns the Name field value func (o *CreateServerPayload) GetName() (ret CreateServerPayloadGetNameRetType) { ret, _ = o.GetNameOk() @@ -1068,6 +1113,9 @@ func (o CreateServerPayload) ToMap() (map[string]interface{}, error) { if val, ok := getCreateServerPayloadGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow); ok { toSerialize["MaintenanceWindow"] = val } + if val, ok := getCreateServerPayloadGetMetadataAttributeTypeOk(o.Metadata); ok { + toSerialize["Metadata"] = val + } if val, ok := getCreateServerPayloadGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val } diff --git a/services/iaas/model_server.go b/services/iaas/model_server.go index 7e2b79b50..d5b812da9 100644 --- a/services/iaas/model_server.go +++ b/services/iaas/model_server.go @@ -265,6 +265,26 @@ func setServerGetMaintenanceWindowAttributeType(arg *ServerGetMaintenanceWindowA *arg = &val } +/* + types and functions for metadata +*/ + +// isFreeform +type ServerGetMetadataAttributeType = *map[string]interface{} +type ServerGetMetadataArgType = map[string]interface{} +type ServerGetMetadataRetType = map[string]interface{} + +func getServerGetMetadataAttributeTypeOk(arg ServerGetMetadataAttributeType) (ret ServerGetMetadataRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setServerGetMetadataAttributeType(arg *ServerGetMetadataAttributeType, val ServerGetMetadataRetType) { + *arg = &val +} + /* types and functions for name */ @@ -493,6 +513,8 @@ type Server struct { // REQUIRED MachineType ServerGetMachineTypeAttributeType `json:"machineType" required:"true"` MaintenanceWindow ServerGetMaintenanceWindowAttributeType `json:"maintenanceWindow,omitempty"` + // Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. + Metadata ServerGetMetadataAttributeType `json:"metadata,omitempty"` // The name for a Server. // REQUIRED Name ServerGetNameAttributeType `json:"name" required:"true"` @@ -806,6 +828,29 @@ func (o *Server) SetMaintenanceWindow(v ServerGetMaintenanceWindowRetType) { setServerGetMaintenanceWindowAttributeType(&o.MaintenanceWindow, v) } +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *Server) GetMetadata() (res ServerGetMetadataRetType) { + res, _ = o.GetMetadataOk() + return +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetMetadataOk() (ret ServerGetMetadataRetType, ok bool) { + return getServerGetMetadataAttributeTypeOk(o.Metadata) +} + +// HasMetadata returns a boolean if a field has been set. +func (o *Server) HasMetadata() bool { + _, ok := o.GetMetadataOk() + return ok +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *Server) SetMetadata(v ServerGetMetadataRetType) { + setServerGetMetadataAttributeType(&o.Metadata, v) +} + // GetName returns the Name field value func (o *Server) GetName() (ret ServerGetNameRetType) { ret, _ = o.GetNameOk() @@ -1068,6 +1113,9 @@ func (o Server) ToMap() (map[string]interface{}, error) { if val, ok := getServerGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow); ok { toSerialize["MaintenanceWindow"] = val } + if val, ok := getServerGetMetadataAttributeTypeOk(o.Metadata); ok { + toSerialize["Metadata"] = val + } if val, ok := getServerGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val } diff --git a/services/iaas/model_update_server_payload.go b/services/iaas/model_update_server_payload.go index e61f9063d..bc080c747 100644 --- a/services/iaas/model_update_server_payload.go +++ b/services/iaas/model_update_server_payload.go @@ -37,6 +37,26 @@ func setUpdateServerPayloadGetLabelsAttributeType(arg *UpdateServerPayloadGetLab *arg = &val } +/* + types and functions for metadata +*/ + +// isFreeform +type UpdateServerPayloadGetMetadataAttributeType = *map[string]interface{} +type UpdateServerPayloadGetMetadataArgType = map[string]interface{} +type UpdateServerPayloadGetMetadataRetType = map[string]interface{} + +func getUpdateServerPayloadGetMetadataAttributeTypeOk(arg UpdateServerPayloadGetMetadataAttributeType) (ret UpdateServerPayloadGetMetadataRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setUpdateServerPayloadGetMetadataAttributeType(arg *UpdateServerPayloadGetMetadataAttributeType, val UpdateServerPayloadGetMetadataRetType) { + *arg = &val +} + /* types and functions for name */ @@ -62,6 +82,8 @@ type UpdateServerPayloadGetNameRetType = string type UpdateServerPayload struct { // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Labels UpdateServerPayloadGetLabelsAttributeType `json:"labels,omitempty"` + // Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. + Metadata UpdateServerPayloadGetMetadataAttributeType `json:"metadata,omitempty"` // The name for a Server. Name UpdateServerPayloadGetNameAttributeType `json:"name,omitempty"` } @@ -106,6 +128,29 @@ func (o *UpdateServerPayload) SetLabels(v UpdateServerPayloadGetLabelsRetType) { setUpdateServerPayloadGetLabelsAttributeType(&o.Labels, v) } +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *UpdateServerPayload) GetMetadata() (res UpdateServerPayloadGetMetadataRetType) { + res, _ = o.GetMetadataOk() + return +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateServerPayload) GetMetadataOk() (ret UpdateServerPayloadGetMetadataRetType, ok bool) { + return getUpdateServerPayloadGetMetadataAttributeTypeOk(o.Metadata) +} + +// HasMetadata returns a boolean if a field has been set. +func (o *UpdateServerPayload) HasMetadata() bool { + _, ok := o.GetMetadataOk() + return ok +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *UpdateServerPayload) SetMetadata(v UpdateServerPayloadGetMetadataRetType) { + setUpdateServerPayloadGetMetadataAttributeType(&o.Metadata, v) +} + // GetName returns the Name field value if set, zero value otherwise. func (o *UpdateServerPayload) GetName() (res UpdateServerPayloadGetNameRetType) { res, _ = o.GetNameOk() @@ -134,6 +179,9 @@ func (o UpdateServerPayload) ToMap() (map[string]interface{}, error) { if val, ok := getUpdateServerPayloadGetLabelsAttributeTypeOk(o.Labels); ok { toSerialize["Labels"] = val } + if val, ok := getUpdateServerPayloadGetMetadataAttributeTypeOk(o.Metadata); ok { + toSerialize["Metadata"] = val + } if val, ok := getUpdateServerPayloadGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val }