diff --git a/services/postgresflex/model_clone_instance_overrides.go b/services/postgresflex/model_clone_instance_overrides.go index de82248c3..dcbc8495d 100644 --- a/services/postgresflex/model_clone_instance_overrides.go +++ b/services/postgresflex/model_clone_instance_overrides.go @@ -103,7 +103,8 @@ func setCloneInstanceOverridesGetSizeAttributeType(arg *CloneInstanceOverridesGe // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CloneInstanceOverrides struct { // The storage class for the storage. - Class CloneInstanceOverridesGetClassAttributeType `json:"class,omitempty"` + // REQUIRED + Class CloneInstanceOverridesGetClassAttributeType `json:"class" required:"true"` // The name of the cloned instance. If not provided, the default naming behavior of appending '-clone' to the source instance name is used. Name CloneInstanceOverridesGetNameAttributeType `json:"name,omitempty"` // The storage size in Gigabytes. @@ -119,8 +120,9 @@ type _CloneInstanceOverrides CloneInstanceOverrides // 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 NewCloneInstanceOverrides(size CloneInstanceOverridesGetSizeArgType) *CloneInstanceOverrides { +func NewCloneInstanceOverrides(class CloneInstanceOverridesGetClassArgType, size CloneInstanceOverridesGetSizeArgType) *CloneInstanceOverrides { this := CloneInstanceOverrides{} + setCloneInstanceOverridesGetClassAttributeType(&this.Class, class) setCloneInstanceOverridesGetSizeAttributeType(&this.Size, size) return &this } @@ -134,28 +136,21 @@ func NewCloneInstanceOverridesWithDefaults() *CloneInstanceOverrides { return &this } -// GetClass returns the Class field value if set, zero value otherwise. +// GetClass returns the Class field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CloneInstanceOverrides) GetClass() (res CloneInstanceOverridesGetClassRetType) { - res, _ = o.GetClassOk() - return +func (o *CloneInstanceOverrides) GetClass() (ret CloneInstanceOverridesGetClassRetType) { + ret, _ = o.GetClassOk() + return ret } -// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// GetClassOk returns a tuple with the Class 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 *CloneInstanceOverrides) GetClassOk() (ret CloneInstanceOverridesGetClassRetType, ok bool) { return getCloneInstanceOverridesGetClassAttributeTypeOk(o.Class) } -// HasClass 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 *CloneInstanceOverrides) HasClass() bool { - _, ok := o.GetClassOk() - return ok -} - -// SetClass gets a reference to the given string and assigns it to the Class field. +// SetClass sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CloneInstanceOverrides) SetClass(v CloneInstanceOverridesGetClassRetType) { setCloneInstanceOverridesGetClassAttributeType(&o.Class, v) diff --git a/services/postgresflex/model_storage_create.go b/services/postgresflex/model_storage_create.go index eac3db97e..1529885e4 100644 --- a/services/postgresflex/model_storage_create.go +++ b/services/postgresflex/model_storage_create.go @@ -76,7 +76,8 @@ func setStorageCreateGetSizeAttributeType(arg *StorageCreateGetSizeAttributeType // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StorageCreate struct { // The storage class for the storage. - Class StorageCreateGetClassAttributeType `json:"class,omitempty"` + // REQUIRED + Class StorageCreateGetClassAttributeType `json:"class" required:"true"` // The storage size in Gigabytes. // REQUIRED Size StorageCreateGetSizeAttributeType `json:"size" required:"true"` @@ -90,8 +91,9 @@ type _StorageCreate StorageCreate // 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 NewStorageCreate(size StorageCreateGetSizeArgType) *StorageCreate { +func NewStorageCreate(class StorageCreateGetClassArgType, size StorageCreateGetSizeArgType) *StorageCreate { this := StorageCreate{} + setStorageCreateGetClassAttributeType(&this.Class, class) setStorageCreateGetSizeAttributeType(&this.Size, size) return &this } @@ -105,28 +107,21 @@ func NewStorageCreateWithDefaults() *StorageCreate { return &this } -// GetClass returns the Class field value if set, zero value otherwise. +// GetClass returns the Class field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *StorageCreate) GetClass() (res StorageCreateGetClassRetType) { - res, _ = o.GetClassOk() - return +func (o *StorageCreate) GetClass() (ret StorageCreateGetClassRetType) { + ret, _ = o.GetClassOk() + return ret } -// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// GetClassOk returns a tuple with the Class 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 *StorageCreate) GetClassOk() (ret StorageCreateGetClassRetType, ok bool) { return getStorageCreateGetClassAttributeTypeOk(o.Class) } -// HasClass 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 *StorageCreate) HasClass() bool { - _, ok := o.GetClassOk() - return ok -} - -// SetClass gets a reference to the given string and assigns it to the Class field. +// SetClass sets field value // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StorageCreate) SetClass(v StorageCreateGetClassRetType) { setStorageCreateGetClassAttributeType(&o.Class, v) diff --git a/services/postgresflex/oas_commit b/services/postgresflex/oas_commit index 5be2ed399..c2d5477e1 100644 --- a/services/postgresflex/oas_commit +++ b/services/postgresflex/oas_commit @@ -1 +1 @@ -3743740fd64567e45d0d0136ba9002f4f3c5e495 +72f3b665150d5f27cb0acf9a30bf8645b1dcea9e diff --git a/services/postgresflex/v1api/client.go b/services/postgresflex/v1api/client.go index bdaf73ab8..f1e05d5ac 100644 --- a/services/postgresflex/v1api/client.go +++ b/services/postgresflex/v1api/client.go @@ -462,6 +462,15 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err *s = string(b) return nil } + if r, ok := v.(*io.Reader); ok { + *r = bytes.NewReader(b) + return nil + } + // Must stay before the JSON branch: json.Unmarshal would base64-decode into *[]byte. + if p, ok := v.(*[]byte); ok { + *p = b + return nil + } if f, ok := v.(*os.File); ok { f, err = os.CreateTemp("", "HttpClientFile") if err != nil { diff --git a/services/postgresflex/v2api/client.go b/services/postgresflex/v2api/client.go index 1c627f749..f4bffb7fa 100644 --- a/services/postgresflex/v2api/client.go +++ b/services/postgresflex/v2api/client.go @@ -462,6 +462,15 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err *s = string(b) return nil } + if r, ok := v.(*io.Reader); ok { + *r = bytes.NewReader(b) + return nil + } + // Must stay before the JSON branch: json.Unmarshal would base64-decode into *[]byte. + if p, ok := v.(*[]byte); ok { + *p = b + return nil + } if f, ok := v.(*os.File); ok { f, err = os.CreateTemp("", "HttpClientFile") if err != nil { diff --git a/services/postgresflex/v3alpha1api/client.go b/services/postgresflex/v3alpha1api/client.go index 897fcaba1..9f7918a19 100644 --- a/services/postgresflex/v3alpha1api/client.go +++ b/services/postgresflex/v3alpha1api/client.go @@ -462,6 +462,15 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err *s = string(b) return nil } + if r, ok := v.(*io.Reader); ok { + *r = bytes.NewReader(b) + return nil + } + // Must stay before the JSON branch: json.Unmarshal would base64-decode into *[]byte. + if p, ok := v.(*[]byte); ok { + *p = b + return nil + } if f, ok := v.(*os.File); ok { f, err = os.CreateTemp("", "HttpClientFile") if err != nil { diff --git a/services/postgresflex/v3alpha1api/model_create_instance_request_payload.go b/services/postgresflex/v3alpha1api/model_create_instance_request_payload.go index f6934190d..3011fe21d 100644 --- a/services/postgresflex/v3alpha1api/model_create_instance_request_payload.go +++ b/services/postgresflex/v3alpha1api/model_create_instance_request_payload.go @@ -27,7 +27,7 @@ type CreateInstanceRequestPayload struct { // The id of the instance flavor. FlavorId string `json:"flavorId"` // Key-value pairs, 63 characters max, begin and end with an alphanumerical character, may contain dashes (-), underscores (_), dots (.), and alphanumerics between. Key MUST be at least 1 character. Max 64 labels 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])*$ The stackit- prefix is reserved and cannot be used for Keys. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]*string `json:"labels,omitempty"` // The name of the instance. Name string `json:"name"` Network InstanceNetworkCreate `json:"network"` @@ -148,9 +148,9 @@ func (o *CreateInstanceRequestPayload) SetFlavorId(v string) { } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateInstanceRequestPayload) GetLabels() map[string]string { +func (o *CreateInstanceRequestPayload) GetLabels() map[string]*string { if o == nil || IsNil(o.Labels) { - var ret map[string]string + var ret map[string]*string return ret } return *o.Labels @@ -158,7 +158,7 @@ func (o *CreateInstanceRequestPayload) GetLabels() map[string]string { // 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 *CreateInstanceRequestPayload) GetLabelsOk() (*map[string]string, bool) { +func (o *CreateInstanceRequestPayload) GetLabelsOk() (*map[string]*string, bool) { if o == nil || IsNil(o.Labels) { return nil, false } @@ -174,8 +174,8 @@ func (o *CreateInstanceRequestPayload) HasLabels() bool { return false } -// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *CreateInstanceRequestPayload) SetLabels(v map[string]string) { +// SetLabels gets a reference to the given map[string]*string and assigns it to the Labels field. +func (o *CreateInstanceRequestPayload) SetLabels(v map[string]*string) { o.Labels = &v } diff --git a/services/postgresflex/v3alpha1api/model_get_instance_response.go b/services/postgresflex/v3alpha1api/model_get_instance_response.go index 4c0b1589b..a416f1560 100644 --- a/services/postgresflex/v3alpha1api/model_get_instance_response.go +++ b/services/postgresflex/v3alpha1api/model_get_instance_response.go @@ -34,7 +34,7 @@ type GetInstanceResponse struct { // Whether the instance can be deleted or not. IsDeletable bool `json:"isDeletable"` // Key-value pairs, 63 characters max, begin and end with an alphanumerical character, may contain dashes (-), underscores (_), dots (.), and alphanumerics between. Key MUST be at least 1 character. Max 64 labels 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])*$ The stackit- prefix is reserved and cannot be used for Keys. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]*string `json:"labels,omitempty"` // The name of the instance. Name string `json:"name"` Network InstanceNetwork `json:"network"` @@ -267,9 +267,9 @@ func (o *GetInstanceResponse) SetIsDeletable(v bool) { } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *GetInstanceResponse) GetLabels() map[string]string { +func (o *GetInstanceResponse) GetLabels() map[string]*string { if o == nil || IsNil(o.Labels) { - var ret map[string]string + var ret map[string]*string return ret } return *o.Labels @@ -277,7 +277,7 @@ func (o *GetInstanceResponse) GetLabels() map[string]string { // 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 *GetInstanceResponse) GetLabelsOk() (*map[string]string, bool) { +func (o *GetInstanceResponse) GetLabelsOk() (*map[string]*string, bool) { if o == nil || IsNil(o.Labels) { return nil, false } @@ -293,8 +293,8 @@ func (o *GetInstanceResponse) HasLabels() bool { return false } -// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *GetInstanceResponse) SetLabels(v map[string]string) { +// SetLabels gets a reference to the given map[string]*string and assigns it to the Labels field. +func (o *GetInstanceResponse) SetLabels(v map[string]*string) { o.Labels = &v } diff --git a/services/postgresflex/v3alpha1api/model_update_instance_partially_request_payload.go b/services/postgresflex/v3alpha1api/model_update_instance_partially_request_payload.go index 3229a4019..0cf178780 100644 --- a/services/postgresflex/v3alpha1api/model_update_instance_partially_request_payload.go +++ b/services/postgresflex/v3alpha1api/model_update_instance_partially_request_payload.go @@ -25,7 +25,7 @@ type UpdateInstancePartiallyRequestPayload struct { // The id of the instance flavor. FlavorId *string `json:"flavorId,omitempty"` // Key-value pairs, 63 characters max, begin and end with an alphanumerical character, may contain dashes (-), underscores (_), dots (.), and alphanumerics between. Key MUST be at least 1 character. Max 64 labels 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])*$ The stackit- prefix is reserved and cannot be used for Keys. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]*string `json:"labels,omitempty"` // The name of the instance. Name *string `json:"name,omitempty"` Network *InstanceNetworkOpt `json:"network,omitempty"` @@ -123,9 +123,9 @@ func (o *UpdateInstancePartiallyRequestPayload) SetFlavorId(v string) { } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateInstancePartiallyRequestPayload) GetLabels() map[string]string { +func (o *UpdateInstancePartiallyRequestPayload) GetLabels() map[string]*string { if o == nil || IsNil(o.Labels) { - var ret map[string]string + var ret map[string]*string return ret } return *o.Labels @@ -133,7 +133,7 @@ func (o *UpdateInstancePartiallyRequestPayload) GetLabels() map[string]string { // 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 *UpdateInstancePartiallyRequestPayload) GetLabelsOk() (*map[string]string, bool) { +func (o *UpdateInstancePartiallyRequestPayload) GetLabelsOk() (*map[string]*string, bool) { if o == nil || IsNil(o.Labels) { return nil, false } @@ -149,8 +149,8 @@ func (o *UpdateInstancePartiallyRequestPayload) HasLabels() bool { return false } -// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *UpdateInstancePartiallyRequestPayload) SetLabels(v map[string]string) { +// SetLabels gets a reference to the given map[string]*string and assigns it to the Labels field. +func (o *UpdateInstancePartiallyRequestPayload) SetLabels(v map[string]*string) { o.Labels = &v } diff --git a/services/postgresflex/v3alpha1api/model_update_instance_request_payload.go b/services/postgresflex/v3alpha1api/model_update_instance_request_payload.go index 44596aeb4..b1b83e257 100644 --- a/services/postgresflex/v3alpha1api/model_update_instance_request_payload.go +++ b/services/postgresflex/v3alpha1api/model_update_instance_request_payload.go @@ -26,7 +26,7 @@ type UpdateInstanceRequestPayload struct { // The id of the instance flavor. FlavorId string `json:"flavorId"` // Key-value pairs, 63 characters max, begin and end with an alphanumerical character, may contain dashes (-), underscores (_), dots (.), and alphanumerics between. Key MUST be at least 1 character. Max 64 labels 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])*$ The stackit- prefix is reserved and cannot be used for Keys. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]*string `json:"labels,omitempty"` // The name of the instance. Name string `json:"name"` Network InstanceNetworkUpdate `json:"network"` @@ -115,9 +115,9 @@ func (o *UpdateInstanceRequestPayload) SetFlavorId(v string) { } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateInstanceRequestPayload) GetLabels() map[string]string { +func (o *UpdateInstanceRequestPayload) GetLabels() map[string]*string { if o == nil || IsNil(o.Labels) { - var ret map[string]string + var ret map[string]*string return ret } return *o.Labels @@ -125,7 +125,7 @@ func (o *UpdateInstanceRequestPayload) GetLabels() map[string]string { // 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 *UpdateInstanceRequestPayload) GetLabelsOk() (*map[string]string, bool) { +func (o *UpdateInstanceRequestPayload) GetLabelsOk() (*map[string]*string, bool) { if o == nil || IsNil(o.Labels) { return nil, false } @@ -141,8 +141,8 @@ func (o *UpdateInstanceRequestPayload) HasLabels() bool { return false } -// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *UpdateInstanceRequestPayload) SetLabels(v map[string]string) { +// SetLabels gets a reference to the given map[string]*string and assigns it to the Labels field. +func (o *UpdateInstanceRequestPayload) SetLabels(v map[string]*string) { o.Labels = &v } diff --git a/services/postgresflex/v3api/client.go b/services/postgresflex/v3api/client.go index 7f004f9d2..65f6421da 100644 --- a/services/postgresflex/v3api/client.go +++ b/services/postgresflex/v3api/client.go @@ -462,6 +462,15 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err *s = string(b) return nil } + if r, ok := v.(*io.Reader); ok { + *r = bytes.NewReader(b) + return nil + } + // Must stay before the JSON branch: json.Unmarshal would base64-decode into *[]byte. + if p, ok := v.(*[]byte); ok { + *p = b + return nil + } if f, ok := v.(*os.File); ok { f, err = os.CreateTemp("", "HttpClientFile") if err != nil { diff --git a/services/postgresflex/v3api/model_clone_instance_overrides.go b/services/postgresflex/v3api/model_clone_instance_overrides.go index 546f20042..6943d5bd5 100644 --- a/services/postgresflex/v3api/model_clone_instance_overrides.go +++ b/services/postgresflex/v3api/model_clone_instance_overrides.go @@ -22,7 +22,7 @@ var _ MappedNullable = &CloneInstanceOverrides{} // CloneInstanceOverrides struct for CloneInstanceOverrides type CloneInstanceOverrides struct { // The storage class for the storage. - Class *string `json:"class,omitempty"` + Class string `json:"class"` // The name of the cloned instance. If not provided, the default naming behavior of appending '-clone' to the source instance name is used. Name *string `json:"name,omitempty"` // The storage size in Gigabytes. @@ -36,8 +36,9 @@ type _CloneInstanceOverrides CloneInstanceOverrides // 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 NewCloneInstanceOverrides(size int64) *CloneInstanceOverrides { +func NewCloneInstanceOverrides(class string, size int64) *CloneInstanceOverrides { this := CloneInstanceOverrides{} + this.Class = class this.Size = size return &this } @@ -50,36 +51,28 @@ func NewCloneInstanceOverridesWithDefaults() *CloneInstanceOverrides { return &this } -// GetClass returns the Class field value if set, zero value otherwise. +// GetClass returns the Class field value func (o *CloneInstanceOverrides) GetClass() string { - if o == nil || IsNil(o.Class) { + if o == nil { var ret string return ret } - return *o.Class + + return o.Class } -// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// GetClassOk returns a tuple with the Class field value // and a boolean to check if the value has been set. func (o *CloneInstanceOverrides) GetClassOk() (*string, bool) { - if o == nil || IsNil(o.Class) { + if o == nil { return nil, false } - return o.Class, true -} - -// HasClass returns a boolean if a field has been set. -func (o *CloneInstanceOverrides) HasClass() bool { - if o != nil && !IsNil(o.Class) { - return true - } - - return false + return &o.Class, true } -// SetClass gets a reference to the given string and assigns it to the Class field. +// SetClass sets field value func (o *CloneInstanceOverrides) SetClass(v string) { - o.Class = &v + o.Class = v } // GetName returns the Name field value if set, zero value otherwise. @@ -148,9 +141,7 @@ func (o CloneInstanceOverrides) MarshalJSON() ([]byte, error) { func (o CloneInstanceOverrides) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Class) { - toSerialize["class"] = o.Class - } + toSerialize["class"] = o.Class if !IsNil(o.Name) { toSerialize["name"] = o.Name } @@ -168,6 +159,7 @@ func (o *CloneInstanceOverrides) UnmarshalJSON(data []byte) (err error) { // 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{ + "class", "size", } diff --git a/services/postgresflex/v3api/model_create_instance_payload.go b/services/postgresflex/v3api/model_create_instance_payload.go index c12a9d94e..46e653828 100644 --- a/services/postgresflex/v3api/model_create_instance_payload.go +++ b/services/postgresflex/v3api/model_create_instance_payload.go @@ -27,7 +27,7 @@ type CreateInstancePayload struct { // The id of the instance flavor. FlavorId string `json:"flavorId"` // Key-value pairs, 63 characters max, begin and end with an alphanumerical character, may contain dashes (-), underscores (_), dots (.), and alphanumerics between. Key MUST be at least 1 character. Max 64 labels 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])*$ The stackit- prefix is reserved and cannot be used for Keys. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]*string `json:"labels,omitempty"` // The name of the instance. Name string `json:"name"` Network InstanceNetworkCreate `json:"network"` @@ -146,9 +146,9 @@ func (o *CreateInstancePayload) SetFlavorId(v string) { } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateInstancePayload) GetLabels() map[string]string { +func (o *CreateInstancePayload) GetLabels() map[string]*string { if o == nil || IsNil(o.Labels) { - var ret map[string]string + var ret map[string]*string return ret } return *o.Labels @@ -156,7 +156,7 @@ func (o *CreateInstancePayload) GetLabels() map[string]string { // 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 *CreateInstancePayload) GetLabelsOk() (*map[string]string, bool) { +func (o *CreateInstancePayload) GetLabelsOk() (*map[string]*string, bool) { if o == nil || IsNil(o.Labels) { return nil, false } @@ -172,8 +172,8 @@ func (o *CreateInstancePayload) HasLabels() bool { return false } -// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *CreateInstancePayload) SetLabels(v map[string]string) { +// SetLabels gets a reference to the given map[string]*string and assigns it to the Labels field. +func (o *CreateInstancePayload) SetLabels(v map[string]*string) { o.Labels = &v } diff --git a/services/postgresflex/v3api/model_get_instance_response.go b/services/postgresflex/v3api/model_get_instance_response.go index d9d872bed..a6c458e00 100644 --- a/services/postgresflex/v3api/model_get_instance_response.go +++ b/services/postgresflex/v3api/model_get_instance_response.go @@ -32,7 +32,7 @@ type GetInstanceResponse struct { // Whether the instance can be deleted or not. IsDeletable bool `json:"isDeletable"` // Key-value pairs, 63 characters max, begin and end with an alphanumerical character, may contain dashes (-), underscores (_), dots (.), and alphanumerics between. Key MUST be at least 1 character. Max 64 labels 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])*$ The stackit- prefix is reserved and cannot be used for Keys. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]*string `json:"labels,omitempty"` // The name of the instance. Name string `json:"name"` Network InstanceNetwork `json:"network"` @@ -228,9 +228,9 @@ func (o *GetInstanceResponse) SetIsDeletable(v bool) { } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *GetInstanceResponse) GetLabels() map[string]string { +func (o *GetInstanceResponse) GetLabels() map[string]*string { if o == nil || IsNil(o.Labels) { - var ret map[string]string + var ret map[string]*string return ret } return *o.Labels @@ -238,7 +238,7 @@ func (o *GetInstanceResponse) GetLabels() map[string]string { // 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 *GetInstanceResponse) GetLabelsOk() (*map[string]string, bool) { +func (o *GetInstanceResponse) GetLabelsOk() (*map[string]*string, bool) { if o == nil || IsNil(o.Labels) { return nil, false } @@ -254,8 +254,8 @@ func (o *GetInstanceResponse) HasLabels() bool { return false } -// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *GetInstanceResponse) SetLabels(v map[string]string) { +// SetLabels gets a reference to the given map[string]*string and assigns it to the Labels field. +func (o *GetInstanceResponse) SetLabels(v map[string]*string) { o.Labels = &v } diff --git a/services/postgresflex/v3api/model_partial_update_instance_payload.go b/services/postgresflex/v3api/model_partial_update_instance_payload.go index 47a25a964..81303bf06 100644 --- a/services/postgresflex/v3api/model_partial_update_instance_payload.go +++ b/services/postgresflex/v3api/model_partial_update_instance_payload.go @@ -25,7 +25,7 @@ type PartialUpdateInstancePayload struct { // The id of the instance flavor. FlavorId *string `json:"flavorId,omitempty"` // Key-value pairs, 63 characters max, begin and end with an alphanumerical character, may contain dashes (-), underscores (_), dots (.), and alphanumerics between. Key MUST be at least 1 character. Max 64 labels 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])*$ The stackit- prefix is reserved and cannot be used for Keys. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]*string `json:"labels,omitempty"` // The name of the instance. Name *string `json:"name,omitempty"` Network *InstanceNetworkOpt `json:"network,omitempty"` @@ -121,9 +121,9 @@ func (o *PartialUpdateInstancePayload) SetFlavorId(v string) { } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *PartialUpdateInstancePayload) GetLabels() map[string]string { +func (o *PartialUpdateInstancePayload) GetLabels() map[string]*string { if o == nil || IsNil(o.Labels) { - var ret map[string]string + var ret map[string]*string return ret } return *o.Labels @@ -131,7 +131,7 @@ func (o *PartialUpdateInstancePayload) GetLabels() map[string]string { // 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 *PartialUpdateInstancePayload) GetLabelsOk() (*map[string]string, bool) { +func (o *PartialUpdateInstancePayload) GetLabelsOk() (*map[string]*string, bool) { if o == nil || IsNil(o.Labels) { return nil, false } @@ -147,8 +147,8 @@ func (o *PartialUpdateInstancePayload) HasLabels() bool { return false } -// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *PartialUpdateInstancePayload) SetLabels(v map[string]string) { +// SetLabels gets a reference to the given map[string]*string and assigns it to the Labels field. +func (o *PartialUpdateInstancePayload) SetLabels(v map[string]*string) { o.Labels = &v } diff --git a/services/postgresflex/v3api/model_storage_create.go b/services/postgresflex/v3api/model_storage_create.go index 810220b65..b8e084405 100644 --- a/services/postgresflex/v3api/model_storage_create.go +++ b/services/postgresflex/v3api/model_storage_create.go @@ -22,7 +22,7 @@ var _ MappedNullable = &StorageCreate{} // StorageCreate The object containing information about the storage size and class. type StorageCreate struct { // The storage class for the storage. - Class *string `json:"class,omitempty"` + Class string `json:"class"` // The storage size in Gigabytes. Size int64 `json:"size"` AdditionalProperties map[string]interface{} @@ -34,8 +34,9 @@ type _StorageCreate StorageCreate // 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 NewStorageCreate(size int64) *StorageCreate { +func NewStorageCreate(class string, size int64) *StorageCreate { this := StorageCreate{} + this.Class = class this.Size = size return &this } @@ -48,36 +49,28 @@ func NewStorageCreateWithDefaults() *StorageCreate { return &this } -// GetClass returns the Class field value if set, zero value otherwise. +// GetClass returns the Class field value func (o *StorageCreate) GetClass() string { - if o == nil || IsNil(o.Class) { + if o == nil { var ret string return ret } - return *o.Class + + return o.Class } -// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// GetClassOk returns a tuple with the Class field value // and a boolean to check if the value has been set. func (o *StorageCreate) GetClassOk() (*string, bool) { - if o == nil || IsNil(o.Class) { + if o == nil { return nil, false } - return o.Class, true -} - -// HasClass returns a boolean if a field has been set. -func (o *StorageCreate) HasClass() bool { - if o != nil && !IsNil(o.Class) { - return true - } - - return false + return &o.Class, true } -// SetClass gets a reference to the given string and assigns it to the Class field. +// SetClass sets field value func (o *StorageCreate) SetClass(v string) { - o.Class = &v + o.Class = v } // GetSize returns the Size field value @@ -114,9 +107,7 @@ func (o StorageCreate) MarshalJSON() ([]byte, error) { func (o StorageCreate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Class) { - toSerialize["class"] = o.Class - } + toSerialize["class"] = o.Class toSerialize["size"] = o.Size for key, value := range o.AdditionalProperties { @@ -131,6 +122,7 @@ func (o *StorageCreate) UnmarshalJSON(data []byte) (err error) { // 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{ + "class", "size", } diff --git a/services/postgresflex/v3api/model_update_instance_payload.go b/services/postgresflex/v3api/model_update_instance_payload.go index cf9b3d1cb..1f88528c1 100644 --- a/services/postgresflex/v3api/model_update_instance_payload.go +++ b/services/postgresflex/v3api/model_update_instance_payload.go @@ -26,7 +26,7 @@ type UpdateInstancePayload struct { // The id of the instance flavor. FlavorId string `json:"flavorId"` // Key-value pairs, 63 characters max, begin and end with an alphanumerical character, may contain dashes (-), underscores (_), dots (.), and alphanumerics between. Key MUST be at least 1 character. Max 64 labels 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])*$ The stackit- prefix is reserved and cannot be used for Keys. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]*string `json:"labels,omitempty"` // The name of the instance. Name string `json:"name"` Network InstanceNetworkUpdate `json:"network"` @@ -113,9 +113,9 @@ func (o *UpdateInstancePayload) SetFlavorId(v string) { } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateInstancePayload) GetLabels() map[string]string { +func (o *UpdateInstancePayload) GetLabels() map[string]*string { if o == nil || IsNil(o.Labels) { - var ret map[string]string + var ret map[string]*string return ret } return *o.Labels @@ -123,7 +123,7 @@ func (o *UpdateInstancePayload) GetLabels() map[string]string { // 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 *UpdateInstancePayload) GetLabelsOk() (*map[string]string, bool) { +func (o *UpdateInstancePayload) GetLabelsOk() (*map[string]*string, bool) { if o == nil || IsNil(o.Labels) { return nil, false } @@ -139,8 +139,8 @@ func (o *UpdateInstancePayload) HasLabels() bool { return false } -// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *UpdateInstancePayload) SetLabels(v map[string]string) { +// SetLabels gets a reference to the given map[string]*string and assigns it to the Labels field. +func (o *UpdateInstancePayload) SetLabels(v map[string]*string) { o.Labels = &v } diff --git a/services/postgresflex/v3beta1api/client.go b/services/postgresflex/v3beta1api/client.go index 6465acf91..a07267541 100644 --- a/services/postgresflex/v3beta1api/client.go +++ b/services/postgresflex/v3beta1api/client.go @@ -462,6 +462,15 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err *s = string(b) return nil } + if r, ok := v.(*io.Reader); ok { + *r = bytes.NewReader(b) + return nil + } + // Must stay before the JSON branch: json.Unmarshal would base64-decode into *[]byte. + if p, ok := v.(*[]byte); ok { + *p = b + return nil + } if f, ok := v.(*os.File); ok { f, err = os.CreateTemp("", "HttpClientFile") if err != nil { diff --git a/services/postgresflex/v3beta1api/model_create_instance_payload.go b/services/postgresflex/v3beta1api/model_create_instance_payload.go index 1d1efb4ff..e91d1fe53 100644 --- a/services/postgresflex/v3beta1api/model_create_instance_payload.go +++ b/services/postgresflex/v3beta1api/model_create_instance_payload.go @@ -27,7 +27,7 @@ type CreateInstancePayload struct { // The id of the instance flavor. FlavorId string `json:"flavorId"` // Key-value pairs, 63 characters max, begin and end with an alphanumerical character, may contain dashes (-), underscores (_), dots (.), and alphanumerics between. Key MUST be at least 1 character. Max 64 labels 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])*$ The stackit- prefix is reserved and cannot be used for Keys. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]*string `json:"labels,omitempty"` // The name of the instance. Name string `json:"name"` Network InstanceNetworkCreate `json:"network"` @@ -146,9 +146,9 @@ func (o *CreateInstancePayload) SetFlavorId(v string) { } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *CreateInstancePayload) GetLabels() map[string]string { +func (o *CreateInstancePayload) GetLabels() map[string]*string { if o == nil || IsNil(o.Labels) { - var ret map[string]string + var ret map[string]*string return ret } return *o.Labels @@ -156,7 +156,7 @@ func (o *CreateInstancePayload) GetLabels() map[string]string { // 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 *CreateInstancePayload) GetLabelsOk() (*map[string]string, bool) { +func (o *CreateInstancePayload) GetLabelsOk() (*map[string]*string, bool) { if o == nil || IsNil(o.Labels) { return nil, false } @@ -172,8 +172,8 @@ func (o *CreateInstancePayload) HasLabels() bool { return false } -// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *CreateInstancePayload) SetLabels(v map[string]string) { +// SetLabels gets a reference to the given map[string]*string and assigns it to the Labels field. +func (o *CreateInstancePayload) SetLabels(v map[string]*string) { o.Labels = &v } diff --git a/services/postgresflex/v3beta1api/model_get_instance_response.go b/services/postgresflex/v3beta1api/model_get_instance_response.go index a7e974612..e1c8a7c5d 100644 --- a/services/postgresflex/v3beta1api/model_get_instance_response.go +++ b/services/postgresflex/v3beta1api/model_get_instance_response.go @@ -34,7 +34,7 @@ type GetInstanceResponse struct { // Whether the instance can be deleted or not. IsDeletable bool `json:"isDeletable"` // Key-value pairs, 63 characters max, begin and end with an alphanumerical character, may contain dashes (-), underscores (_), dots (.), and alphanumerics between. Key MUST be at least 1 character. Max 64 labels 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])*$ The stackit- prefix is reserved and cannot be used for Keys. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]*string `json:"labels,omitempty"` // The name of the instance. Name string `json:"name"` Network InstanceNetwork `json:"network"` @@ -262,9 +262,9 @@ func (o *GetInstanceResponse) SetIsDeletable(v bool) { } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *GetInstanceResponse) GetLabels() map[string]string { +func (o *GetInstanceResponse) GetLabels() map[string]*string { if o == nil || IsNil(o.Labels) { - var ret map[string]string + var ret map[string]*string return ret } return *o.Labels @@ -272,7 +272,7 @@ func (o *GetInstanceResponse) GetLabels() map[string]string { // 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 *GetInstanceResponse) GetLabelsOk() (*map[string]string, bool) { +func (o *GetInstanceResponse) GetLabelsOk() (*map[string]*string, bool) { if o == nil || IsNil(o.Labels) { return nil, false } @@ -288,8 +288,8 @@ func (o *GetInstanceResponse) HasLabels() bool { return false } -// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *GetInstanceResponse) SetLabels(v map[string]string) { +// SetLabels gets a reference to the given map[string]*string and assigns it to the Labels field. +func (o *GetInstanceResponse) SetLabels(v map[string]*string) { o.Labels = &v } diff --git a/services/postgresflex/v3beta1api/model_partial_update_instance_payload.go b/services/postgresflex/v3beta1api/model_partial_update_instance_payload.go index a7a527d5a..646f7cc0f 100644 --- a/services/postgresflex/v3beta1api/model_partial_update_instance_payload.go +++ b/services/postgresflex/v3beta1api/model_partial_update_instance_payload.go @@ -25,7 +25,7 @@ type PartialUpdateInstancePayload struct { // The id of the instance flavor. FlavorId *string `json:"flavorId,omitempty"` // Key-value pairs, 63 characters max, begin and end with an alphanumerical character, may contain dashes (-), underscores (_), dots (.), and alphanumerics between. Key MUST be at least 1 character. Max 64 labels 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])*$ The stackit- prefix is reserved and cannot be used for Keys. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]*string `json:"labels,omitempty"` // The name of the instance. Name *string `json:"name,omitempty"` Network *InstanceNetworkOpt `json:"network,omitempty"` @@ -121,9 +121,9 @@ func (o *PartialUpdateInstancePayload) SetFlavorId(v string) { } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *PartialUpdateInstancePayload) GetLabels() map[string]string { +func (o *PartialUpdateInstancePayload) GetLabels() map[string]*string { if o == nil || IsNil(o.Labels) { - var ret map[string]string + var ret map[string]*string return ret } return *o.Labels @@ -131,7 +131,7 @@ func (o *PartialUpdateInstancePayload) GetLabels() map[string]string { // 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 *PartialUpdateInstancePayload) GetLabelsOk() (*map[string]string, bool) { +func (o *PartialUpdateInstancePayload) GetLabelsOk() (*map[string]*string, bool) { if o == nil || IsNil(o.Labels) { return nil, false } @@ -147,8 +147,8 @@ func (o *PartialUpdateInstancePayload) HasLabels() bool { return false } -// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *PartialUpdateInstancePayload) SetLabels(v map[string]string) { +// SetLabels gets a reference to the given map[string]*string and assigns it to the Labels field. +func (o *PartialUpdateInstancePayload) SetLabels(v map[string]*string) { o.Labels = &v } diff --git a/services/postgresflex/v3beta1api/model_update_instance_payload.go b/services/postgresflex/v3beta1api/model_update_instance_payload.go index 3358817f7..a9a8f8461 100644 --- a/services/postgresflex/v3beta1api/model_update_instance_payload.go +++ b/services/postgresflex/v3beta1api/model_update_instance_payload.go @@ -26,7 +26,7 @@ type UpdateInstancePayload struct { // The id of the instance flavor. FlavorId string `json:"flavorId"` // Key-value pairs, 63 characters max, begin and end with an alphanumerical character, may contain dashes (-), underscores (_), dots (.), and alphanumerics between. Key MUST be at least 1 character. Max 64 labels 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])*$ The stackit- prefix is reserved and cannot be used for Keys. - Labels *map[string]string `json:"labels,omitempty"` + Labels *map[string]*string `json:"labels,omitempty"` // The name of the instance. Name string `json:"name"` Network InstanceNetworkUpdate `json:"network"` @@ -113,9 +113,9 @@ func (o *UpdateInstancePayload) SetFlavorId(v string) { } // GetLabels returns the Labels field value if set, zero value otherwise. -func (o *UpdateInstancePayload) GetLabels() map[string]string { +func (o *UpdateInstancePayload) GetLabels() map[string]*string { if o == nil || IsNil(o.Labels) { - var ret map[string]string + var ret map[string]*string return ret } return *o.Labels @@ -123,7 +123,7 @@ func (o *UpdateInstancePayload) GetLabels() map[string]string { // 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 *UpdateInstancePayload) GetLabelsOk() (*map[string]string, bool) { +func (o *UpdateInstancePayload) GetLabelsOk() (*map[string]*string, bool) { if o == nil || IsNil(o.Labels) { return nil, false } @@ -139,8 +139,8 @@ func (o *UpdateInstancePayload) HasLabels() bool { return false } -// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. -func (o *UpdateInstancePayload) SetLabels(v map[string]string) { +// SetLabels gets a reference to the given map[string]*string and assigns it to the Labels field. +func (o *UpdateInstancePayload) SetLabels(v map[string]*string) { o.Labels = &v }