diff --git a/services/iaas/go.mod b/services/iaas/go.mod index e378480cd..813cf5b83 100644 --- a/services/iaas/go.mod +++ b/services/iaas/go.mod @@ -5,7 +5,7 @@ go 1.25 require ( github.com/google/go-cmp v0.7.0 github.com/stackitcloud/stackit-sdk-go/core v0.26.0 - github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.24.0 + github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.24.1 ) require ( diff --git a/services/iaas/go.sum b/services/iaas/go.sum index 3212faed2..8d37a23c8 100644 --- a/services/iaas/go.sum +++ b/services/iaas/go.sum @@ -6,5 +6,5 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/stackitcloud/stackit-sdk-go/core v0.26.0 h1:jQEb9gkehfp6VCP6TcYk7BI10cz4l0KM2L6hqYBH2QA= github.com/stackitcloud/stackit-sdk-go/core v0.26.0/go.mod h1:WU1hhxnjXw2EV7CYa1nlEvNpMiRY6CvmIOaHuL3pOaA= -github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.24.0 h1:JPP6a0ME1tZXr4iB69d/LtJsCAr58ENBadFaK9f48/c= -github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.24.0/go.mod h1:NEz3f+GV5G++BE9/MmZCsXJyCih7jtg0pZuSyG2sLEs= +github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.24.1 h1:gslS9O2KiYbY2CUn49IQx7RnEXud2Q0ALOGrrob+u2E= +github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.24.1/go.mod h1:NEz3f+GV5G++BE9/MmZCsXJyCih7jtg0pZuSyG2sLEs= diff --git a/services/iaas/model_create_server_payload.go b/services/iaas/model_create_server_payload.go index d167f4d18..4c3c490fb 100644 --- a/services/iaas/model_create_server_payload.go +++ b/services/iaas/model_create_server_payload.go @@ -694,33 +694,6 @@ func setCreateServerPayloadGetVolumesAttributeType(arg *CreateServerPayloadGetVo *arg = &val } -/* - types and functions for vtpm -*/ - -// isModel -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateServerPayloadGetVtpmAttributeType = *ServerVtpm - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateServerPayloadGetVtpmArgType = ServerVtpm - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateServerPayloadGetVtpmRetType = ServerVtpm - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateServerPayloadGetVtpmAttributeTypeOk(arg CreateServerPayloadGetVtpmAttributeType) (ret CreateServerPayloadGetVtpmRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setCreateServerPayloadGetVtpmAttributeType(arg *CreateServerPayloadGetVtpmAttributeType, val CreateServerPayloadGetVtpmRetType) { - *arg = &val -} - // CreateServerPayload Object that represents the request body for a server create. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayload struct { @@ -773,7 +746,6 @@ type CreateServerPayload struct { UserData CreateServerPayloadGetUserDataAttributeType `json:"userData,omitempty"` // A list of UUIDs. Volumes CreateServerPayloadGetVolumesAttributeType `json:"volumes,omitempty"` - Vtpm CreateServerPayloadGetVtpmAttributeType `json:"vtpm,omitempty"` } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1457,33 +1429,6 @@ func (o *CreateServerPayload) SetVolumes(v CreateServerPayloadGetVolumesRetType) setCreateServerPayloadGetVolumesAttributeType(&o.Volumes, v) } -// GetVtpm returns the Vtpm field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateServerPayload) GetVtpm() (res CreateServerPayloadGetVtpmRetType) { - res, _ = o.GetVtpmOk() - return -} - -// GetVtpmOk returns a tuple with the Vtpm field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateServerPayload) GetVtpmOk() (ret CreateServerPayloadGetVtpmRetType, ok bool) { - return getCreateServerPayloadGetVtpmAttributeTypeOk(o.Vtpm) -} - -// HasVtpm returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateServerPayload) HasVtpm() bool { - _, ok := o.GetVtpmOk() - return ok -} - -// SetVtpm gets a reference to the given ServerVtpm and assigns it to the Vtpm field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateServerPayload) SetVtpm(v CreateServerPayloadGetVtpmRetType) { - setCreateServerPayloadGetVtpmAttributeType(&o.Vtpm, v) -} - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateServerPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} @@ -1562,9 +1507,6 @@ func (o CreateServerPayload) ToMap() (map[string]interface{}, error) { if val, ok := getCreateServerPayloadGetVolumesAttributeTypeOk(o.Volumes); ok { toSerialize["Volumes"] = val } - if val, ok := getCreateServerPayloadGetVtpmAttributeTypeOk(o.Vtpm); ok { - toSerialize["Vtpm"] = val - } return toSerialize, nil } diff --git a/services/iaas/model_server.go b/services/iaas/model_server.go index 1c625b9e1..e09fd92cf 100644 --- a/services/iaas/model_server.go +++ b/services/iaas/model_server.go @@ -694,33 +694,6 @@ func setServerGetVolumesAttributeType(arg *ServerGetVolumesAttributeType, val Se *arg = &val } -/* - types and functions for vtpm -*/ - -// isModel -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ServerGetVtpmAttributeType = *ServerVtpm - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ServerGetVtpmArgType = ServerVtpm - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ServerGetVtpmRetType = ServerVtpm - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getServerGetVtpmAttributeTypeOk(arg ServerGetVtpmAttributeType) (ret ServerGetVtpmRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setServerGetVtpmAttributeType(arg *ServerGetVtpmAttributeType, val ServerGetVtpmRetType) { - *arg = &val -} - // Server Representation of a single server object. // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Server struct { @@ -772,7 +745,6 @@ type Server struct { UserData ServerGetUserDataAttributeType `json:"userData,omitempty"` // A list of UUIDs. Volumes ServerGetVolumesAttributeType `json:"volumes,omitempty"` - Vtpm ServerGetVtpmAttributeType `json:"vtpm,omitempty"` } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -1462,33 +1434,6 @@ func (o *Server) SetVolumes(v ServerGetVolumesRetType) { setServerGetVolumesAttributeType(&o.Volumes, v) } -// GetVtpm returns the Vtpm field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Server) GetVtpm() (res ServerGetVtpmRetType) { - res, _ = o.GetVtpmOk() - return -} - -// GetVtpmOk returns a tuple with the Vtpm field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Server) GetVtpmOk() (ret ServerGetVtpmRetType, ok bool) { - return getServerGetVtpmAttributeTypeOk(o.Vtpm) -} - -// HasVtpm returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Server) HasVtpm() bool { - _, ok := o.GetVtpmOk() - return ok -} - -// SetVtpm gets a reference to the given ServerVtpm and assigns it to the Vtpm field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Server) SetVtpm(v ServerGetVtpmRetType) { - setServerGetVtpmAttributeType(&o.Vtpm, v) -} - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Server) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} @@ -1567,9 +1512,6 @@ func (o Server) ToMap() (map[string]interface{}, error) { if val, ok := getServerGetVolumesAttributeTypeOk(o.Volumes); ok { toSerialize["Volumes"] = val } - if val, ok := getServerGetVtpmAttributeTypeOk(o.Vtpm); ok { - toSerialize["Vtpm"] = val - } return toSerialize, nil } diff --git a/services/iaas/model_server_vtpm.go b/services/iaas/model_server_vtpm.go deleted file mode 100644 index 132fa9300..000000000 --- a/services/iaas/model_server_vtpm.go +++ /dev/null @@ -1,152 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package iaas - -import ( - "encoding/json" -) - -// checks if the ServerVtpm type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ServerVtpm{} - -/* - types and functions for enabled -*/ - -// isBoolean -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ServerVtpmgetEnabledAttributeType = *bool - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ServerVtpmgetEnabledArgType = bool - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ServerVtpmgetEnabledRetType = bool - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getServerVtpmgetEnabledAttributeTypeOk(arg ServerVtpmgetEnabledAttributeType) (ret ServerVtpmgetEnabledRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func setServerVtpmgetEnabledAttributeType(arg *ServerVtpmgetEnabledAttributeType, val ServerVtpmgetEnabledRetType) { - *arg = &val -} - -// ServerVtpm struct for ServerVtpm -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ServerVtpm struct { - // Defines whether the server instance has the Virtual Trusted Platform Module (vTPM) enabled. - // REQUIRED - Enabled ServerVtpmgetEnabledAttributeType `json:"enabled" required:"true"` -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type _ServerVtpm ServerVtpm - -// NewServerVtpm instantiates a new ServerVtpm object -// 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 -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewServerVtpm(enabled ServerVtpmgetEnabledArgType) *ServerVtpm { - this := ServerVtpm{} - setServerVtpmgetEnabledAttributeType(&this.Enabled, enabled) - return &this -} - -// NewServerVtpmWithDefaults instantiates a new ServerVtpm object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewServerVtpmWithDefaults() *ServerVtpm { - this := ServerVtpm{} - var enabled bool = false - this.Enabled = &enabled - return &this -} - -// GetEnabled returns the Enabled field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ServerVtpm) GetEnabled() (ret ServerVtpmgetEnabledRetType) { - ret, _ = o.GetEnabledOk() - return ret -} - -// GetEnabledOk returns a tuple with the Enabled field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ServerVtpm) GetEnabledOk() (ret ServerVtpmgetEnabledRetType, ok bool) { - return getServerVtpmgetEnabledAttributeTypeOk(o.Enabled) -} - -// SetEnabled sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *ServerVtpm) SetEnabled(v ServerVtpmgetEnabledRetType) { - setServerVtpmgetEnabledAttributeType(&o.Enabled, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o ServerVtpm) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getServerVtpmgetEnabledAttributeTypeOk(o.Enabled); ok { - toSerialize["Enabled"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableServerVtpm struct { - value *ServerVtpm - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableServerVtpm) Get() *ServerVtpm { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableServerVtpm) Set(val *ServerVtpm) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableServerVtpm) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableServerVtpm) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableServerVtpm(val *ServerVtpm) *NullableServerVtpm { - return &NullableServerVtpm{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableServerVtpm) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableServerVtpm) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/model_server_vtpm_test.go b/services/iaas/model_server_vtpm_test.go deleted file mode 100644 index 603b15988..000000000 --- a/services/iaas/model_server_vtpm_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package iaas diff --git a/services/iaas/oas_commit b/services/iaas/oas_commit index 2fd4b6b8b..da1ca1cac 100644 --- a/services/iaas/oas_commit +++ b/services/iaas/oas_commit @@ -1 +1 @@ -f05986bf33be92fa5cbe425bcf5e4a11dd3c7463 +602a933a8a6cc22c52171febbca7ceaf63bc7538 diff --git a/services/iaas/v1api/model_area_id.go b/services/iaas/v1api/model_area_id.go index 4c26ea620..370cb216e 100644 --- a/services/iaas/v1api/model_area_id.go +++ b/services/iaas/v1api/model_area_id.go @@ -14,6 +14,7 @@ package v1api import ( "encoding/json" "fmt" + "regexp" ) // AreaId - The identifier (ID) of an area. @@ -57,10 +58,13 @@ func (dst *AreaId) UnmarshalJSON(data []byte) error { err = json.Unmarshal(data, &dst.String) if err == nil { jsonString, _ := json.Marshal(dst.String) - if string(jsonString) == "{}" { // empty struct - dst.String = nil - } else { + // OVERRIDE: this pattern match is custom + regex := `^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$` + isMatched, _ := regexp.MatchString(regex, *dst.String) + if string(jsonString) != "{}" && isMatched { // empty struct match++ + } else { + dst.String = nil } } else { dst.String = nil diff --git a/services/iaas/v1api/model_create_server_payload.go b/services/iaas/v1api/model_create_server_payload.go index 2153f52a2..8b4768afb 100644 --- a/services/iaas/v1api/model_create_server_payload.go +++ b/services/iaas/v1api/model_create_server_payload.go @@ -67,8 +67,7 @@ type CreateServerPayload struct { // User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init to the server. Only shown when detailed information is requested. UserData *string `json:"userData,omitempty"` // The list of volumes attached to the server. - Volumes []string `json:"volumes,omitempty"` - Vtpm *ServerVTPM `json:"vtpm,omitempty"` + Volumes []string `json:"volumes,omitempty"` AdditionalProperties map[string]interface{} } @@ -881,38 +880,6 @@ func (o *CreateServerPayload) SetVolumes(v []string) { o.Volumes = v } -// GetVtpm returns the Vtpm field value if set, zero value otherwise. -func (o *CreateServerPayload) GetVtpm() ServerVTPM { - if o == nil || IsNil(o.Vtpm) { - var ret ServerVTPM - return ret - } - return *o.Vtpm -} - -// GetVtpmOk returns a tuple with the Vtpm field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetVtpmOk() (*ServerVTPM, bool) { - if o == nil || IsNil(o.Vtpm) { - return nil, false - } - return o.Vtpm, true -} - -// HasVtpm returns a boolean if a field has been set. -func (o *CreateServerPayload) HasVtpm() bool { - if o != nil && !IsNil(o.Vtpm) { - return true - } - - return false -} - -// SetVtpm gets a reference to the given ServerVTPM and assigns it to the Vtpm field. -func (o *CreateServerPayload) SetVtpm(v ServerVTPM) { - o.Vtpm = &v -} - func (o CreateServerPayload) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -994,9 +961,6 @@ func (o CreateServerPayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.Volumes) { toSerialize["volumes"] = o.Volumes } - if !IsNil(o.Vtpm) { - toSerialize["vtpm"] = o.Vtpm - } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -1066,7 +1030,6 @@ func (o *CreateServerPayload) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "updatedAt") delete(additionalProperties, "userData") delete(additionalProperties, "volumes") - delete(additionalProperties, "vtpm") o.AdditionalProperties = additionalProperties } diff --git a/services/iaas/v1api/model_server.go b/services/iaas/v1api/model_server.go index 7605774eb..b4affe75b 100644 --- a/services/iaas/v1api/model_server.go +++ b/services/iaas/v1api/model_server.go @@ -67,8 +67,7 @@ type Server struct { // User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init to the server. Only shown when detailed information is requested. UserData *string `json:"userData,omitempty"` // The list of volumes attached to the server. - Volumes []string `json:"volumes,omitempty"` - Vtpm *ServerVTPM `json:"vtpm,omitempty"` + Volumes []string `json:"volumes,omitempty"` AdditionalProperties map[string]interface{} } @@ -881,38 +880,6 @@ func (o *Server) SetVolumes(v []string) { o.Volumes = v } -// GetVtpm returns the Vtpm field value if set, zero value otherwise. -func (o *Server) GetVtpm() ServerVTPM { - if o == nil || IsNil(o.Vtpm) { - var ret ServerVTPM - return ret - } - return *o.Vtpm -} - -// GetVtpmOk returns a tuple with the Vtpm field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetVtpmOk() (*ServerVTPM, bool) { - if o == nil || IsNil(o.Vtpm) { - return nil, false - } - return o.Vtpm, true -} - -// HasVtpm returns a boolean if a field has been set. -func (o *Server) HasVtpm() bool { - if o != nil && !IsNil(o.Vtpm) { - return true - } - - return false -} - -// SetVtpm gets a reference to the given ServerVTPM and assigns it to the Vtpm field. -func (o *Server) SetVtpm(v ServerVTPM) { - o.Vtpm = &v -} - func (o Server) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -994,9 +961,6 @@ func (o Server) ToMap() (map[string]interface{}, error) { if !IsNil(o.Volumes) { toSerialize["volumes"] = o.Volumes } - if !IsNil(o.Vtpm) { - toSerialize["vtpm"] = o.Vtpm - } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -1066,7 +1030,6 @@ func (o *Server) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "updatedAt") delete(additionalProperties, "userData") delete(additionalProperties, "volumes") - delete(additionalProperties, "vtpm") o.AdditionalProperties = additionalProperties } diff --git a/services/iaas/v1api/model_server_vtpm.go b/services/iaas/v1api/model_server_vtpm.go deleted file mode 100644 index 89a13a044..000000000 --- a/services/iaas/v1api/model_server_vtpm.go +++ /dev/null @@ -1,170 +0,0 @@ -/* -STACKIT IaaS API - -This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. - -API version: 1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the ServerVTPM type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ServerVTPM{} - -// ServerVTPM Configuration for the Virtual Trusted Platform Module (vTPM). -type ServerVTPM struct { - // Defines whether the server instance has the Virtual Trusted Platform Module (vTPM) enabled. - Enabled bool `json:"enabled"` - AdditionalProperties map[string]interface{} -} - -type _ServerVTPM ServerVTPM - -// NewServerVTPM instantiates a new ServerVTPM object -// 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 NewServerVTPM(enabled bool) *ServerVTPM { - this := ServerVTPM{} - this.Enabled = enabled - return &this -} - -// NewServerVTPMWithDefaults instantiates a new ServerVTPM object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewServerVTPMWithDefaults() *ServerVTPM { - this := ServerVTPM{} - var enabled bool = false - this.Enabled = enabled - return &this -} - -// GetEnabled returns the Enabled field value -func (o *ServerVTPM) GetEnabled() bool { - if o == nil { - var ret bool - return ret - } - - return o.Enabled -} - -// GetEnabledOk returns a tuple with the Enabled field value -// and a boolean to check if the value has been set. -func (o *ServerVTPM) GetEnabledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Enabled, true -} - -// SetEnabled sets field value -func (o *ServerVTPM) SetEnabled(v bool) { - o.Enabled = v -} - -func (o ServerVTPM) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ServerVTPM) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["enabled"] = o.Enabled - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ServerVTPM) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "enabled", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varServerVTPM := _ServerVTPM{} - - err = json.Unmarshal(data, &varServerVTPM) - - if err != nil { - return err - } - - *o = ServerVTPM(varServerVTPM) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "enabled") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableServerVTPM struct { - value *ServerVTPM - isSet bool -} - -func (v NullableServerVTPM) Get() *ServerVTPM { - return v.value -} - -func (v *NullableServerVTPM) Set(val *ServerVTPM) { - v.value = val - v.isSet = true -} - -func (v NullableServerVTPM) IsSet() bool { - return v.isSet -} - -func (v *NullableServerVTPM) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableServerVTPM(val *ServerVTPM) *NullableServerVTPM { - return &NullableServerVTPM{value: val, isSet: true} -} - -func (v NullableServerVTPM) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableServerVTPM) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2alpha1api/model_create_vpc_network_range_payload.go b/services/iaas/v2alpha1api/model_create_vpc_network_range_payload.go index dde072d2d..f4295955a 100644 --- a/services/iaas/v2alpha1api/model_create_vpc_network_range_payload.go +++ b/services/iaas/v2alpha1api/model_create_vpc_network_range_payload.go @@ -16,388 +16,73 @@ import ( "fmt" ) -// checks if the CreateVPCNetworkRangePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateVPCNetworkRangePayload{} - -// CreateVPCNetworkRangePayload The request body of a VPC network range. +// CreateVPCNetworkRangePayload - The request body of a VPC network range. type CreateVPCNetworkRangePayload struct { - // The default prefix length for network ranges in the VPC. - DefaultPrefixLen *int64 `json:"defaultPrefixLen,omitempty"` - // Description Object. Allows string up to 255 Characters. - Description *string `json:"description,omitempty"` - IpVersion NetworkRangeIPv4RequestIpVersion `json:"ipVersion"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - // The maximal prefix length for network ranges in the VPC. - MaxPrefixLen *int64 `json:"maxPrefixLen,omitempty"` - // The minimal prefix length for network ranges in the VPC. - MinPrefixLen *int64 `json:"minPrefixLen,omitempty"` - // A list containing DNS Servers/Nameservers for IPv4. - Nameservers []string `json:"nameservers,omitempty"` - // Classless Inter-Domain Routing (CIDR). - Prefix string `json:"prefix" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` - AdditionalProperties map[string]interface{} -} - -type _CreateVPCNetworkRangePayload CreateVPCNetworkRangePayload - -// NewCreateVPCNetworkRangePayload instantiates a new CreateVPCNetworkRangePayload object -// 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 NewCreateVPCNetworkRangePayload(ipVersion NetworkRangeIPv4RequestIpVersion, prefix string) *CreateVPCNetworkRangePayload { - this := CreateVPCNetworkRangePayload{} - var defaultPrefixLen int64 = 25 - this.DefaultPrefixLen = &defaultPrefixLen - this.IpVersion = ipVersion - var maxPrefixLen int64 = 29 - this.MaxPrefixLen = &maxPrefixLen - var minPrefixLen int64 = 24 - this.MinPrefixLen = &minPrefixLen - this.Prefix = prefix - return &this -} - -// NewCreateVPCNetworkRangePayloadWithDefaults instantiates a new CreateVPCNetworkRangePayload object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCreateVPCNetworkRangePayloadWithDefaults() *CreateVPCNetworkRangePayload { - this := CreateVPCNetworkRangePayload{} - var defaultPrefixLen int64 = 25 - this.DefaultPrefixLen = &defaultPrefixLen - var maxPrefixLen int64 = 29 - this.MaxPrefixLen = &maxPrefixLen - var minPrefixLen int64 = 24 - this.MinPrefixLen = &minPrefixLen - return &this -} - -// GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. -func (o *CreateVPCNetworkRangePayload) GetDefaultPrefixLen() int64 { - if o == nil || IsNil(o.DefaultPrefixLen) { - var ret int64 - return ret - } - return *o.DefaultPrefixLen -} - -// GetDefaultPrefixLenOk returns a tuple with the DefaultPrefixLen field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateVPCNetworkRangePayload) GetDefaultPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.DefaultPrefixLen) { - return nil, false - } - return o.DefaultPrefixLen, true -} - -// HasDefaultPrefixLen returns a boolean if a field has been set. -func (o *CreateVPCNetworkRangePayload) HasDefaultPrefixLen() bool { - if o != nil && !IsNil(o.DefaultPrefixLen) { - return true - } - - return false -} - -// SetDefaultPrefixLen gets a reference to the given int64 and assigns it to the DefaultPrefixLen field. -func (o *CreateVPCNetworkRangePayload) SetDefaultPrefixLen(v int64) { - o.DefaultPrefixLen = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *CreateVPCNetworkRangePayload) GetDescription() string { - if o == nil || IsNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateVPCNetworkRangePayload) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *CreateVPCNetworkRangePayload) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *CreateVPCNetworkRangePayload) SetDescription(v string) { - o.Description = &v -} - -// GetIpVersion returns the IpVersion field value -func (o *CreateVPCNetworkRangePayload) GetIpVersion() NetworkRangeIPv4RequestIpVersion { - if o == nil { - var ret NetworkRangeIPv4RequestIpVersion - return ret - } - - return o.IpVersion -} - -// GetIpVersionOk returns a tuple with the IpVersion field value -// and a boolean to check if the value has been set. -func (o *CreateVPCNetworkRangePayload) GetIpVersionOk() (*NetworkRangeIPv4RequestIpVersion, bool) { - if o == nil { - return nil, false - } - return &o.IpVersion, true -} - -// SetIpVersion sets field value -func (o *CreateVPCNetworkRangePayload) SetIpVersion(v NetworkRangeIPv4RequestIpVersion) { - o.IpVersion = v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateVPCNetworkRangePayload) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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 *CreateVPCNetworkRangePayload) GetLabelsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *CreateVPCNetworkRangePayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *CreateVPCNetworkRangePayload) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. -func (o *CreateVPCNetworkRangePayload) GetMaxPrefixLen() int64 { - if o == nil || IsNil(o.MaxPrefixLen) { - var ret int64 - return ret - } - return *o.MaxPrefixLen -} - -// GetMaxPrefixLenOk returns a tuple with the MaxPrefixLen field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateVPCNetworkRangePayload) GetMaxPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MaxPrefixLen) { - return nil, false - } - return o.MaxPrefixLen, true + NetworkRangeIPv4Request *NetworkRangeIPv4Request } -// HasMaxPrefixLen returns a boolean if a field has been set. -func (o *CreateVPCNetworkRangePayload) HasMaxPrefixLen() bool { - if o != nil && !IsNil(o.MaxPrefixLen) { - return true +// NetworkRangeIPv4RequestAsCreateVPCNetworkRangePayload is a convenience function that returns NetworkRangeIPv4Request wrapped in CreateVPCNetworkRangePayload +func NetworkRangeIPv4RequestAsCreateVPCNetworkRangePayload(v *NetworkRangeIPv4Request) CreateVPCNetworkRangePayload { + return CreateVPCNetworkRangePayload{ + NetworkRangeIPv4Request: v, } - - return false -} - -// SetMaxPrefixLen gets a reference to the given int64 and assigns it to the MaxPrefixLen field. -func (o *CreateVPCNetworkRangePayload) SetMaxPrefixLen(v int64) { - o.MaxPrefixLen = &v -} - -// GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. -func (o *CreateVPCNetworkRangePayload) GetMinPrefixLen() int64 { - if o == nil || IsNil(o.MinPrefixLen) { - var ret int64 - return ret - } - return *o.MinPrefixLen -} - -// GetMinPrefixLenOk returns a tuple with the MinPrefixLen field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateVPCNetworkRangePayload) GetMinPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MinPrefixLen) { - return nil, false - } - return o.MinPrefixLen, true -} - -// HasMinPrefixLen returns a boolean if a field has been set. -func (o *CreateVPCNetworkRangePayload) HasMinPrefixLen() bool { - if o != nil && !IsNil(o.MinPrefixLen) { - return true - } - - return false -} - -// SetMinPrefixLen gets a reference to the given int64 and assigns it to the MinPrefixLen field. -func (o *CreateVPCNetworkRangePayload) SetMinPrefixLen(v int64) { - o.MinPrefixLen = &v } -// GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *CreateVPCNetworkRangePayload) GetNameservers() []string { - if o == nil || IsNil(o.Nameservers) { - var ret []string - return ret +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateVPCNetworkRangePayload) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'ipv4' + if jsonDict["ipVersion"] == "ipv4" { + // try to unmarshal JSON data into NetworkRangeIPv4Request + err = json.Unmarshal(data, &dst.NetworkRangeIPv4Request) + if err == nil { + return nil // data stored in dst.NetworkRangeIPv4Request, return on the first match + } else { + dst.NetworkRangeIPv4Request = nil + return fmt.Errorf("failed to unmarshal CreateVPCNetworkRangePayload as NetworkRangeIPv4Request: %s", err.Error()) + } } - return o.Nameservers -} -// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateVPCNetworkRangePayload) GetNameserversOk() ([]string, bool) { - if o == nil || IsNil(o.Nameservers) { - return nil, false - } - return o.Nameservers, true + return nil } -// HasNameservers returns a boolean if a field has been set. -func (o *CreateVPCNetworkRangePayload) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { - return true +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateVPCNetworkRangePayload) MarshalJSON() ([]byte, error) { + if src.NetworkRangeIPv4Request != nil { + return json.Marshal(&src.NetworkRangeIPv4Request) } - return false + return nil, nil // no data in oneOf schemas } -// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *CreateVPCNetworkRangePayload) SetNameservers(v []string) { - o.Nameservers = v -} - -// GetPrefix returns the Prefix field value -func (o *CreateVPCNetworkRangePayload) GetPrefix() string { - if o == nil { - var ret string - return ret +// Get the actual instance +func (obj *CreateVPCNetworkRangePayload) GetActualInstance() interface{} { + if obj == nil { + return nil } - - return o.Prefix -} - -// GetPrefixOk returns a tuple with the Prefix field value -// and a boolean to check if the value has been set. -func (o *CreateVPCNetworkRangePayload) GetPrefixOk() (*string, bool) { - if o == nil { - return nil, false + if obj.NetworkRangeIPv4Request != nil { + return obj.NetworkRangeIPv4Request } - return &o.Prefix, true -} -// SetPrefix sets field value -func (o *CreateVPCNetworkRangePayload) SetPrefix(v string) { - o.Prefix = v -} - -func (o CreateVPCNetworkRangePayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) + // all schemas are nil + return nil } -func (o CreateVPCNetworkRangePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.DefaultPrefixLen) { - toSerialize["defaultPrefixLen"] = o.DefaultPrefixLen - } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description - } - toSerialize["ipVersion"] = o.IpVersion - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - if !IsNil(o.MaxPrefixLen) { - toSerialize["maxPrefixLen"] = o.MaxPrefixLen - } - if !IsNil(o.MinPrefixLen) { - toSerialize["minPrefixLen"] = o.MinPrefixLen - } - if !IsNil(o.Nameservers) { - toSerialize["nameservers"] = o.Nameservers - } - toSerialize["prefix"] = o.Prefix - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *CreateVPCNetworkRangePayload) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "ipVersion", - "prefix", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varCreateVPCNetworkRangePayload := _CreateVPCNetworkRangePayload{} - - err = json.Unmarshal(data, &varCreateVPCNetworkRangePayload) - - if err != nil { - return err - } - - *o = CreateVPCNetworkRangePayload(varCreateVPCNetworkRangePayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "defaultPrefixLen") - delete(additionalProperties, "description") - delete(additionalProperties, "ipVersion") - delete(additionalProperties, "labels") - delete(additionalProperties, "maxPrefixLen") - delete(additionalProperties, "minPrefixLen") - delete(additionalProperties, "nameservers") - delete(additionalProperties, "prefix") - o.AdditionalProperties = additionalProperties +// Get the actual instance value +func (obj CreateVPCNetworkRangePayload) GetActualInstanceValue() interface{} { + if obj.NetworkRangeIPv4Request != nil { + return *obj.NetworkRangeIPv4Request } - return err + // all schemas are nil + return nil } type NullableCreateVPCNetworkRangePayload struct { diff --git a/services/iaas/v2alpha1api/model_update_vpc_network_range_payload.go b/services/iaas/v2alpha1api/model_update_vpc_network_range_payload.go index 7c4d4964e..2f7bb4264 100644 --- a/services/iaas/v2alpha1api/model_update_vpc_network_range_payload.go +++ b/services/iaas/v2alpha1api/model_update_vpc_network_range_payload.go @@ -16,346 +16,73 @@ import ( "fmt" ) -// checks if the UpdateVPCNetworkRangePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateVPCNetworkRangePayload{} - -// UpdateVPCNetworkRangePayload Object that represents the request body for a VPC network range update. +// UpdateVPCNetworkRangePayload - Object that represents the request body for a VPC network range update. type UpdateVPCNetworkRangePayload struct { - // The default prefix length for network ranges in the VPC. - DefaultPrefixLen *int64 `json:"defaultPrefixLen,omitempty"` - // Description Object. Allows string up to 255 Characters. - Description *string `json:"description,omitempty"` - IpVersion V1UpdateVPCNetworkRangeIPv4IpVersion `json:"ipVersion"` - // Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key. The `stackit-` prefix is reserved and cannot be used for Keys. - Labels map[string]interface{} `json:"labels,omitempty"` - // The maximal prefix length for network ranges in the VPC. - MaxPrefixLen *int64 `json:"maxPrefixLen,omitempty"` - // The minimal prefix length for network ranges in the VPC. - MinPrefixLen *int64 `json:"minPrefixLen,omitempty"` - // A list containing DNS Servers/Nameservers for IPv4. - Nameservers []string `json:"nameservers,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _UpdateVPCNetworkRangePayload UpdateVPCNetworkRangePayload - -// NewUpdateVPCNetworkRangePayload instantiates a new UpdateVPCNetworkRangePayload object -// 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 NewUpdateVPCNetworkRangePayload(ipVersion V1UpdateVPCNetworkRangeIPv4IpVersion) *UpdateVPCNetworkRangePayload { - this := UpdateVPCNetworkRangePayload{} - this.IpVersion = ipVersion - return &this -} - -// NewUpdateVPCNetworkRangePayloadWithDefaults instantiates a new UpdateVPCNetworkRangePayload object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUpdateVPCNetworkRangePayloadWithDefaults() *UpdateVPCNetworkRangePayload { - this := UpdateVPCNetworkRangePayload{} - return &this -} - -// GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. -func (o *UpdateVPCNetworkRangePayload) GetDefaultPrefixLen() int64 { - if o == nil || IsNil(o.DefaultPrefixLen) { - var ret int64 - return ret - } - return *o.DefaultPrefixLen + V1UpdateVPCNetworkRangeIPv4 *V1UpdateVPCNetworkRangeIPv4 } -// GetDefaultPrefixLenOk returns a tuple with the DefaultPrefixLen field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateVPCNetworkRangePayload) GetDefaultPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.DefaultPrefixLen) { - return nil, false +// V1UpdateVPCNetworkRangeIPv4AsUpdateVPCNetworkRangePayload is a convenience function that returns V1UpdateVPCNetworkRangeIPv4 wrapped in UpdateVPCNetworkRangePayload +func V1UpdateVPCNetworkRangeIPv4AsUpdateVPCNetworkRangePayload(v *V1UpdateVPCNetworkRangeIPv4) UpdateVPCNetworkRangePayload { + return UpdateVPCNetworkRangePayload{ + V1UpdateVPCNetworkRangeIPv4: v, } - return o.DefaultPrefixLen, true -} - -// HasDefaultPrefixLen returns a boolean if a field has been set. -func (o *UpdateVPCNetworkRangePayload) HasDefaultPrefixLen() bool { - if o != nil && !IsNil(o.DefaultPrefixLen) { - return true - } - - return false -} - -// SetDefaultPrefixLen gets a reference to the given int64 and assigns it to the DefaultPrefixLen field. -func (o *UpdateVPCNetworkRangePayload) SetDefaultPrefixLen(v int64) { - o.DefaultPrefixLen = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *UpdateVPCNetworkRangePayload) GetDescription() string { - if o == nil || IsNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateVPCNetworkRangePayload) GetDescriptionOk() (*string, bool) { - if o == nil || IsNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *UpdateVPCNetworkRangePayload) HasDescription() bool { - if o != nil && !IsNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *UpdateVPCNetworkRangePayload) SetDescription(v string) { - o.Description = &v } -// GetIpVersion returns the IpVersion field value -func (o *UpdateVPCNetworkRangePayload) GetIpVersion() V1UpdateVPCNetworkRangeIPv4IpVersion { - if o == nil { - var ret V1UpdateVPCNetworkRangeIPv4IpVersion - return ret - } - - return o.IpVersion -} - -// GetIpVersionOk returns a tuple with the IpVersion field value -// and a boolean to check if the value has been set. -func (o *UpdateVPCNetworkRangePayload) GetIpVersionOk() (*V1UpdateVPCNetworkRangeIPv4IpVersion, bool) { - if o == nil { - return nil, false - } - return &o.IpVersion, true -} - -// SetIpVersion sets field value -func (o *UpdateVPCNetworkRangePayload) SetIpVersion(v V1UpdateVPCNetworkRangeIPv4IpVersion) { - o.IpVersion = v -} - -// GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateVPCNetworkRangePayload) GetLabels() map[string]interface{} { - if o == nil || IsNil(o.Labels) { - var ret map[string]interface{} - return ret - } - return o.Labels -} - -// 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 *UpdateVPCNetworkRangePayload) GetLabelsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Labels) { - return map[string]interface{}{}, false - } - return o.Labels, true -} - -// HasLabels returns a boolean if a field has been set. -func (o *UpdateVPCNetworkRangePayload) HasLabels() bool { - if o != nil && !IsNil(o.Labels) { - return true - } - - return false -} - -// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. -func (o *UpdateVPCNetworkRangePayload) SetLabels(v map[string]interface{}) { - o.Labels = v -} - -// GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. -func (o *UpdateVPCNetworkRangePayload) GetMaxPrefixLen() int64 { - if o == nil || IsNil(o.MaxPrefixLen) { - var ret int64 - return ret - } - return *o.MaxPrefixLen -} - -// GetMaxPrefixLenOk returns a tuple with the MaxPrefixLen field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateVPCNetworkRangePayload) GetMaxPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MaxPrefixLen) { - return nil, false - } - return o.MaxPrefixLen, true -} - -// HasMaxPrefixLen returns a boolean if a field has been set. -func (o *UpdateVPCNetworkRangePayload) HasMaxPrefixLen() bool { - if o != nil && !IsNil(o.MaxPrefixLen) { - return true - } - - return false -} - -// SetMaxPrefixLen gets a reference to the given int64 and assigns it to the MaxPrefixLen field. -func (o *UpdateVPCNetworkRangePayload) SetMaxPrefixLen(v int64) { - o.MaxPrefixLen = &v -} - -// GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. -func (o *UpdateVPCNetworkRangePayload) GetMinPrefixLen() int64 { - if o == nil || IsNil(o.MinPrefixLen) { - var ret int64 - return ret - } - return *o.MinPrefixLen -} - -// GetMinPrefixLenOk returns a tuple with the MinPrefixLen field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateVPCNetworkRangePayload) GetMinPrefixLenOk() (*int64, bool) { - if o == nil || IsNil(o.MinPrefixLen) { - return nil, false - } - return o.MinPrefixLen, true -} - -// HasMinPrefixLen returns a boolean if a field has been set. -func (o *UpdateVPCNetworkRangePayload) HasMinPrefixLen() bool { - if o != nil && !IsNil(o.MinPrefixLen) { - return true - } - - return false -} - -// SetMinPrefixLen gets a reference to the given int64 and assigns it to the MinPrefixLen field. -func (o *UpdateVPCNetworkRangePayload) SetMinPrefixLen(v int64) { - o.MinPrefixLen = &v -} - -// GetNameservers returns the Nameservers field value if set, zero value otherwise. -func (o *UpdateVPCNetworkRangePayload) GetNameservers() []string { - if o == nil || IsNil(o.Nameservers) { - var ret []string - return ret +// Unmarshal JSON data into one of the pointers in the struct +func (dst *UpdateVPCNetworkRangePayload) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'ipv4' + if jsonDict["ipVersion"] == "ipv4" { + // try to unmarshal JSON data into V1UpdateVPCNetworkRangeIPv4 + err = json.Unmarshal(data, &dst.V1UpdateVPCNetworkRangeIPv4) + if err == nil { + return nil // data stored in dst.V1UpdateVPCNetworkRangeIPv4, return on the first match + } else { + dst.V1UpdateVPCNetworkRangeIPv4 = nil + return fmt.Errorf("failed to unmarshal UpdateVPCNetworkRangePayload as V1UpdateVPCNetworkRangeIPv4: %s", err.Error()) + } } - return o.Nameservers -} -// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateVPCNetworkRangePayload) GetNameserversOk() ([]string, bool) { - if o == nil || IsNil(o.Nameservers) { - return nil, false - } - return o.Nameservers, true + return nil } -// HasNameservers returns a boolean if a field has been set. -func (o *UpdateVPCNetworkRangePayload) HasNameservers() bool { - if o != nil && !IsNil(o.Nameservers) { - return true +// Marshal data from the first non-nil pointers in the struct to JSON +func (src UpdateVPCNetworkRangePayload) MarshalJSON() ([]byte, error) { + if src.V1UpdateVPCNetworkRangeIPv4 != nil { + return json.Marshal(&src.V1UpdateVPCNetworkRangeIPv4) } - return false -} - -// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. -func (o *UpdateVPCNetworkRangePayload) SetNameservers(v []string) { - o.Nameservers = v -} - -func (o UpdateVPCNetworkRangePayload) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) + return nil, nil // no data in oneOf schemas } -func (o UpdateVPCNetworkRangePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.DefaultPrefixLen) { - toSerialize["defaultPrefixLen"] = o.DefaultPrefixLen - } - if !IsNil(o.Description) { - toSerialize["description"] = o.Description - } - toSerialize["ipVersion"] = o.IpVersion - if !IsNil(o.Labels) { - toSerialize["labels"] = o.Labels - } - if !IsNil(o.MaxPrefixLen) { - toSerialize["maxPrefixLen"] = o.MaxPrefixLen - } - if !IsNil(o.MinPrefixLen) { - toSerialize["minPrefixLen"] = o.MinPrefixLen +// Get the actual instance +func (obj *UpdateVPCNetworkRangePayload) GetActualInstance() interface{} { + if obj == nil { + return nil } - if !IsNil(o.Nameservers) { - toSerialize["nameservers"] = o.Nameservers + if obj.V1UpdateVPCNetworkRangeIPv4 != nil { + return obj.V1UpdateVPCNetworkRangeIPv4 } - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil + // all schemas are nil + return nil } -func (o *UpdateVPCNetworkRangePayload) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "ipVersion", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varUpdateVPCNetworkRangePayload := _UpdateVPCNetworkRangePayload{} - - err = json.Unmarshal(data, &varUpdateVPCNetworkRangePayload) - - if err != nil { - return err - } - - *o = UpdateVPCNetworkRangePayload(varUpdateVPCNetworkRangePayload) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "defaultPrefixLen") - delete(additionalProperties, "description") - delete(additionalProperties, "ipVersion") - delete(additionalProperties, "labels") - delete(additionalProperties, "maxPrefixLen") - delete(additionalProperties, "minPrefixLen") - delete(additionalProperties, "nameservers") - o.AdditionalProperties = additionalProperties +// Get the actual instance value +func (obj UpdateVPCNetworkRangePayload) GetActualInstanceValue() interface{} { + if obj.V1UpdateVPCNetworkRangeIPv4 != nil { + return *obj.V1UpdateVPCNetworkRangeIPv4 } - return err + // all schemas are nil + return nil } type NullableUpdateVPCNetworkRangePayload struct { diff --git a/services/iaas/v2api/model_area_id.go b/services/iaas/v2api/model_area_id.go index 3c516b052..bd0b814d4 100644 --- a/services/iaas/v2api/model_area_id.go +++ b/services/iaas/v2api/model_area_id.go @@ -14,6 +14,7 @@ package v2api import ( "encoding/json" "fmt" + "regexp" ) // AreaId - The identifier (ID) of an area. @@ -57,10 +58,13 @@ func (dst *AreaId) UnmarshalJSON(data []byte) error { err = json.Unmarshal(data, &dst.String) if err == nil { jsonString, _ := json.Marshal(dst.String) - if string(jsonString) == "{}" { // empty struct - dst.String = nil - } else { + // OVERRIDE: this pattern match is custom + regex := `^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$` + isMatched, _ := regexp.MatchString(regex, *dst.String) + if string(jsonString) != "{}" && isMatched { // empty struct match++ + } else { + dst.String = nil } } else { dst.String = nil diff --git a/services/iaas/v2api/model_create_server_payload.go b/services/iaas/v2api/model_create_server_payload.go index 3cf6e82ef..1d3dc90c1 100644 --- a/services/iaas/v2api/model_create_server_payload.go +++ b/services/iaas/v2api/model_create_server_payload.go @@ -67,8 +67,7 @@ type CreateServerPayload struct { // User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init to the server. Only shown when detailed information is requested. UserData *string `json:"userData,omitempty"` // The list of volumes attached to the server. - Volumes []string `json:"volumes,omitempty"` - Vtpm *ServerVTPM `json:"vtpm,omitempty"` + Volumes []string `json:"volumes,omitempty"` AdditionalProperties map[string]interface{} } @@ -874,38 +873,6 @@ func (o *CreateServerPayload) SetVolumes(v []string) { o.Volumes = v } -// GetVtpm returns the Vtpm field value if set, zero value otherwise. -func (o *CreateServerPayload) GetVtpm() ServerVTPM { - if o == nil || IsNil(o.Vtpm) { - var ret ServerVTPM - return ret - } - return *o.Vtpm -} - -// GetVtpmOk returns a tuple with the Vtpm field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetVtpmOk() (*ServerVTPM, bool) { - if o == nil || IsNil(o.Vtpm) { - return nil, false - } - return o.Vtpm, true -} - -// HasVtpm returns a boolean if a field has been set. -func (o *CreateServerPayload) HasVtpm() bool { - if o != nil && !IsNil(o.Vtpm) { - return true - } - - return false -} - -// SetVtpm gets a reference to the given ServerVTPM and assigns it to the Vtpm field. -func (o *CreateServerPayload) SetVtpm(v ServerVTPM) { - o.Vtpm = &v -} - func (o CreateServerPayload) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -985,9 +952,6 @@ func (o CreateServerPayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.Volumes) { toSerialize["volumes"] = o.Volumes } - if !IsNil(o.Vtpm) { - toSerialize["vtpm"] = o.Vtpm - } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -1058,7 +1022,6 @@ func (o *CreateServerPayload) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "updatedAt") delete(additionalProperties, "userData") delete(additionalProperties, "volumes") - delete(additionalProperties, "vtpm") o.AdditionalProperties = additionalProperties } diff --git a/services/iaas/v2api/model_server.go b/services/iaas/v2api/model_server.go index f4b40cb6d..e42020960 100644 --- a/services/iaas/v2api/model_server.go +++ b/services/iaas/v2api/model_server.go @@ -67,8 +67,7 @@ type Server struct { // User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init to the server. Only shown when detailed information is requested. UserData *string `json:"userData,omitempty"` // The list of volumes attached to the server. - Volumes []string `json:"volumes,omitempty"` - Vtpm *ServerVTPM `json:"vtpm,omitempty"` + Volumes []string `json:"volumes,omitempty"` AdditionalProperties map[string]interface{} } @@ -881,38 +880,6 @@ func (o *Server) SetVolumes(v []string) { o.Volumes = v } -// GetVtpm returns the Vtpm field value if set, zero value otherwise. -func (o *Server) GetVtpm() ServerVTPM { - if o == nil || IsNil(o.Vtpm) { - var ret ServerVTPM - return ret - } - return *o.Vtpm -} - -// GetVtpmOk returns a tuple with the Vtpm field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetVtpmOk() (*ServerVTPM, bool) { - if o == nil || IsNil(o.Vtpm) { - return nil, false - } - return o.Vtpm, true -} - -// HasVtpm returns a boolean if a field has been set. -func (o *Server) HasVtpm() bool { - if o != nil && !IsNil(o.Vtpm) { - return true - } - - return false -} - -// SetVtpm gets a reference to the given ServerVTPM and assigns it to the Vtpm field. -func (o *Server) SetVtpm(v ServerVTPM) { - o.Vtpm = &v -} - func (o Server) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -994,9 +961,6 @@ func (o Server) ToMap() (map[string]interface{}, error) { if !IsNil(o.Volumes) { toSerialize["volumes"] = o.Volumes } - if !IsNil(o.Vtpm) { - toSerialize["vtpm"] = o.Vtpm - } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -1066,7 +1030,6 @@ func (o *Server) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "updatedAt") delete(additionalProperties, "userData") delete(additionalProperties, "volumes") - delete(additionalProperties, "vtpm") o.AdditionalProperties = additionalProperties } diff --git a/services/iaas/v2api/model_server_vtpm.go b/services/iaas/v2api/model_server_vtpm.go deleted file mode 100644 index b2549e72b..000000000 --- a/services/iaas/v2api/model_server_vtpm.go +++ /dev/null @@ -1,170 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2api - -import ( - "encoding/json" - "fmt" -) - -// checks if the ServerVTPM type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ServerVTPM{} - -// ServerVTPM Configuration for the Virtual Trusted Platform Module (vTPM). -type ServerVTPM struct { - // Defines whether the server instance has the Virtual Trusted Platform Module (vTPM) enabled. - Enabled bool `json:"enabled"` - AdditionalProperties map[string]interface{} -} - -type _ServerVTPM ServerVTPM - -// NewServerVTPM instantiates a new ServerVTPM object -// 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 NewServerVTPM(enabled bool) *ServerVTPM { - this := ServerVTPM{} - this.Enabled = enabled - return &this -} - -// NewServerVTPMWithDefaults instantiates a new ServerVTPM object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewServerVTPMWithDefaults() *ServerVTPM { - this := ServerVTPM{} - var enabled bool = false - this.Enabled = enabled - return &this -} - -// GetEnabled returns the Enabled field value -func (o *ServerVTPM) GetEnabled() bool { - if o == nil { - var ret bool - return ret - } - - return o.Enabled -} - -// GetEnabledOk returns a tuple with the Enabled field value -// and a boolean to check if the value has been set. -func (o *ServerVTPM) GetEnabledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Enabled, true -} - -// SetEnabled sets field value -func (o *ServerVTPM) SetEnabled(v bool) { - o.Enabled = v -} - -func (o ServerVTPM) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ServerVTPM) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["enabled"] = o.Enabled - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ServerVTPM) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "enabled", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varServerVTPM := _ServerVTPM{} - - err = json.Unmarshal(data, &varServerVTPM) - - if err != nil { - return err - } - - *o = ServerVTPM(varServerVTPM) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "enabled") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableServerVTPM struct { - value *ServerVTPM - isSet bool -} - -func (v NullableServerVTPM) Get() *ServerVTPM { - return v.value -} - -func (v *NullableServerVTPM) Set(val *ServerVTPM) { - v.value = val - v.isSet = true -} - -func (v NullableServerVTPM) IsSet() bool { - return v.isSet -} - -func (v *NullableServerVTPM) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableServerVTPM(val *ServerVTPM) *NullableServerVTPM { - return &NullableServerVTPM{value: val, isSet: true} -} - -func (v NullableServerVTPM) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableServerVTPM) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/iaas/v2beta1api/model_area_id.go b/services/iaas/v2beta1api/model_area_id.go index 938c9d001..e6adbeb20 100644 --- a/services/iaas/v2beta1api/model_area_id.go +++ b/services/iaas/v2beta1api/model_area_id.go @@ -14,6 +14,7 @@ package v2beta1api import ( "encoding/json" "fmt" + "regexp" ) // AreaId - The identifier (ID) of an area. @@ -44,10 +45,13 @@ func (dst *AreaId) UnmarshalJSON(data []byte) error { err = json.Unmarshal(data, &dst.StaticAreaID) if err == nil { jsonStaticAreaID, _ := json.Marshal(dst.StaticAreaID) - if string(jsonStaticAreaID) == "{}" { // empty struct - dst.StaticAreaID = nil - } else { + // OVERRIDE: this pattern match is custom + regex := `^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$` + isMatched, _ := regexp.MatchString(regex, string(*dst.StaticAreaID)) + if string(jsonStaticAreaID) != "{}" && isMatched { // empty struct match++ + } else { + dst.StaticAreaID = nil } } else { dst.StaticAreaID = nil diff --git a/services/iaas/v2beta1api/model_create_server_payload.go b/services/iaas/v2beta1api/model_create_server_payload.go index e3067d20d..465c5259c 100644 --- a/services/iaas/v2beta1api/model_create_server_payload.go +++ b/services/iaas/v2beta1api/model_create_server_payload.go @@ -67,8 +67,7 @@ type CreateServerPayload struct { // User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init to the server. Only shown when detailed information is requested. UserData *string `json:"userData,omitempty"` // The list of volumes attached to the server. - Volumes []string `json:"volumes,omitempty"` - Vtpm *ServerVTPM `json:"vtpm,omitempty"` + Volumes []string `json:"volumes,omitempty"` AdditionalProperties map[string]interface{} } @@ -874,38 +873,6 @@ func (o *CreateServerPayload) SetVolumes(v []string) { o.Volumes = v } -// GetVtpm returns the Vtpm field value if set, zero value otherwise. -func (o *CreateServerPayload) GetVtpm() ServerVTPM { - if o == nil || IsNil(o.Vtpm) { - var ret ServerVTPM - return ret - } - return *o.Vtpm -} - -// GetVtpmOk returns a tuple with the Vtpm field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateServerPayload) GetVtpmOk() (*ServerVTPM, bool) { - if o == nil || IsNil(o.Vtpm) { - return nil, false - } - return o.Vtpm, true -} - -// HasVtpm returns a boolean if a field has been set. -func (o *CreateServerPayload) HasVtpm() bool { - if o != nil && !IsNil(o.Vtpm) { - return true - } - - return false -} - -// SetVtpm gets a reference to the given ServerVTPM and assigns it to the Vtpm field. -func (o *CreateServerPayload) SetVtpm(v ServerVTPM) { - o.Vtpm = &v -} - func (o CreateServerPayload) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -985,9 +952,6 @@ func (o CreateServerPayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.Volumes) { toSerialize["volumes"] = o.Volumes } - if !IsNil(o.Vtpm) { - toSerialize["vtpm"] = o.Vtpm - } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -1058,7 +1022,6 @@ func (o *CreateServerPayload) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "updatedAt") delete(additionalProperties, "userData") delete(additionalProperties, "volumes") - delete(additionalProperties, "vtpm") o.AdditionalProperties = additionalProperties } diff --git a/services/iaas/v2beta1api/model_server.go b/services/iaas/v2beta1api/model_server.go index 4209f7ee3..daed84c49 100644 --- a/services/iaas/v2beta1api/model_server.go +++ b/services/iaas/v2beta1api/model_server.go @@ -67,8 +67,7 @@ type Server struct { // User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init to the server. Only shown when detailed information is requested. UserData *string `json:"userData,omitempty"` // The list of volumes attached to the server. - Volumes []string `json:"volumes,omitempty"` - Vtpm *ServerVTPM `json:"vtpm,omitempty"` + Volumes []string `json:"volumes,omitempty"` AdditionalProperties map[string]interface{} } @@ -881,38 +880,6 @@ func (o *Server) SetVolumes(v []string) { o.Volumes = v } -// GetVtpm returns the Vtpm field value if set, zero value otherwise. -func (o *Server) GetVtpm() ServerVTPM { - if o == nil || IsNil(o.Vtpm) { - var ret ServerVTPM - return ret - } - return *o.Vtpm -} - -// GetVtpmOk returns a tuple with the Vtpm field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Server) GetVtpmOk() (*ServerVTPM, bool) { - if o == nil || IsNil(o.Vtpm) { - return nil, false - } - return o.Vtpm, true -} - -// HasVtpm returns a boolean if a field has been set. -func (o *Server) HasVtpm() bool { - if o != nil && !IsNil(o.Vtpm) { - return true - } - - return false -} - -// SetVtpm gets a reference to the given ServerVTPM and assigns it to the Vtpm field. -func (o *Server) SetVtpm(v ServerVTPM) { - o.Vtpm = &v -} - func (o Server) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -994,9 +961,6 @@ func (o Server) ToMap() (map[string]interface{}, error) { if !IsNil(o.Volumes) { toSerialize["volumes"] = o.Volumes } - if !IsNil(o.Vtpm) { - toSerialize["vtpm"] = o.Vtpm - } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -1066,7 +1030,6 @@ func (o *Server) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "updatedAt") delete(additionalProperties, "userData") delete(additionalProperties, "volumes") - delete(additionalProperties, "vtpm") o.AdditionalProperties = additionalProperties } diff --git a/services/iaas/v2beta1api/model_server_vtpm.go b/services/iaas/v2beta1api/model_server_vtpm.go deleted file mode 100644 index 136f796e0..000000000 --- a/services/iaas/v2beta1api/model_server_vtpm.go +++ /dev/null @@ -1,170 +0,0 @@ -/* -STACKIT IaaS API - -This API allows you to create and modify IaaS resources. - -API version: 2beta1 -Contact: stackit-iaas@mail.schwarz -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package v2beta1api - -import ( - "encoding/json" - "fmt" -) - -// checks if the ServerVTPM type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ServerVTPM{} - -// ServerVTPM Configuration for the Virtual Trusted Platform Module (vTPM). -type ServerVTPM struct { - // Defines whether the server instance has the Virtual Trusted Platform Module (vTPM) enabled. - Enabled bool `json:"enabled"` - AdditionalProperties map[string]interface{} -} - -type _ServerVTPM ServerVTPM - -// NewServerVTPM instantiates a new ServerVTPM object -// 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 NewServerVTPM(enabled bool) *ServerVTPM { - this := ServerVTPM{} - this.Enabled = enabled - return &this -} - -// NewServerVTPMWithDefaults instantiates a new ServerVTPM object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewServerVTPMWithDefaults() *ServerVTPM { - this := ServerVTPM{} - var enabled bool = false - this.Enabled = enabled - return &this -} - -// GetEnabled returns the Enabled field value -func (o *ServerVTPM) GetEnabled() bool { - if o == nil { - var ret bool - return ret - } - - return o.Enabled -} - -// GetEnabledOk returns a tuple with the Enabled field value -// and a boolean to check if the value has been set. -func (o *ServerVTPM) GetEnabledOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Enabled, true -} - -// SetEnabled sets field value -func (o *ServerVTPM) SetEnabled(v bool) { - o.Enabled = v -} - -func (o ServerVTPM) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ServerVTPM) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["enabled"] = o.Enabled - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *ServerVTPM) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "enabled", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varServerVTPM := _ServerVTPM{} - - err = json.Unmarshal(data, &varServerVTPM) - - if err != nil { - return err - } - - *o = ServerVTPM(varServerVTPM) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "enabled") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableServerVTPM struct { - value *ServerVTPM - isSet bool -} - -func (v NullableServerVTPM) Get() *ServerVTPM { - return v.value -} - -func (v *NullableServerVTPM) Set(val *ServerVTPM) { - v.value = val - v.isSet = true -} - -func (v NullableServerVTPM) IsSet() bool { - return v.isSet -} - -func (v *NullableServerVTPM) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableServerVTPM(val *ServerVTPM) *NullableServerVTPM { - return &NullableServerVTPM{value: val, isSet: true} -} - -func (v NullableServerVTPM) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableServerVTPM) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -}