terraform-provider-stackitp.../pkg/iaasbeta/model_update_server_payload.go
2026-01-21 09:07:29 +01:00

225 lines
7.6 KiB
Go

/*
STACKIT IaaS API
This API allows you to create and modify IaaS resources.
API version: 2beta1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package iaasbeta
import (
"encoding/json"
)
// checks if the UpdateServerPayload type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &UpdateServerPayload{}
/*
types and functions for labels
*/
// isFreeform
type UpdateServerPayloadGetLabelsAttributeType = *map[string]interface{}
type UpdateServerPayloadGetLabelsArgType = map[string]interface{}
type UpdateServerPayloadGetLabelsRetType = map[string]interface{}
func getUpdateServerPayloadGetLabelsAttributeTypeOk(arg UpdateServerPayloadGetLabelsAttributeType) (ret UpdateServerPayloadGetLabelsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateServerPayloadGetLabelsAttributeType(arg *UpdateServerPayloadGetLabelsAttributeType, val UpdateServerPayloadGetLabelsRetType) {
*arg = &val
}
/*
types and functions for metadata
*/
// isFreeform
type UpdateServerPayloadGetMetadataAttributeType = *map[string]interface{}
type UpdateServerPayloadGetMetadataArgType = map[string]interface{}
type UpdateServerPayloadGetMetadataRetType = map[string]interface{}
func getUpdateServerPayloadGetMetadataAttributeTypeOk(arg UpdateServerPayloadGetMetadataAttributeType) (ret UpdateServerPayloadGetMetadataRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateServerPayloadGetMetadataAttributeType(arg *UpdateServerPayloadGetMetadataAttributeType, val UpdateServerPayloadGetMetadataRetType) {
*arg = &val
}
/*
types and functions for name
*/
// isNotNullableString
type UpdateServerPayloadGetNameAttributeType = *string
func getUpdateServerPayloadGetNameAttributeTypeOk(arg UpdateServerPayloadGetNameAttributeType) (ret UpdateServerPayloadGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateServerPayloadGetNameAttributeType(arg *UpdateServerPayloadGetNameAttributeType, val UpdateServerPayloadGetNameRetType) {
*arg = &val
}
type UpdateServerPayloadGetNameArgType = string
type UpdateServerPayloadGetNameRetType = string
// UpdateServerPayload Object that represents an update request body of a server.
type UpdateServerPayload struct {
// 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.
Labels UpdateServerPayloadGetLabelsAttributeType `json:"labels,omitempty"`
// Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. Providing a `null` value for a key will remove that key.
Metadata UpdateServerPayloadGetMetadataAttributeType `json:"metadata,omitempty"`
// The name for a Server.
Name UpdateServerPayloadGetNameAttributeType `json:"name,omitempty"`
}
// NewUpdateServerPayload instantiates a new UpdateServerPayload 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 NewUpdateServerPayload() *UpdateServerPayload {
this := UpdateServerPayload{}
return &this
}
// NewUpdateServerPayloadWithDefaults instantiates a new UpdateServerPayload 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 NewUpdateServerPayloadWithDefaults() *UpdateServerPayload {
this := UpdateServerPayload{}
return &this
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *UpdateServerPayload) GetLabels() (res UpdateServerPayloadGetLabelsRetType) {
res, _ = o.GetLabelsOk()
return
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateServerPayload) GetLabelsOk() (ret UpdateServerPayloadGetLabelsRetType, ok bool) {
return getUpdateServerPayloadGetLabelsAttributeTypeOk(o.Labels)
}
// HasLabels returns a boolean if a field has been set.
func (o *UpdateServerPayload) HasLabels() bool {
_, ok := o.GetLabelsOk()
return ok
}
// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field.
func (o *UpdateServerPayload) SetLabels(v UpdateServerPayloadGetLabelsRetType) {
setUpdateServerPayloadGetLabelsAttributeType(&o.Labels, v)
}
// GetMetadata returns the Metadata field value if set, zero value otherwise.
func (o *UpdateServerPayload) GetMetadata() (res UpdateServerPayloadGetMetadataRetType) {
res, _ = o.GetMetadataOk()
return
}
// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateServerPayload) GetMetadataOk() (ret UpdateServerPayloadGetMetadataRetType, ok bool) {
return getUpdateServerPayloadGetMetadataAttributeTypeOk(o.Metadata)
}
// HasMetadata returns a boolean if a field has been set.
func (o *UpdateServerPayload) HasMetadata() bool {
_, ok := o.GetMetadataOk()
return ok
}
// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field.
func (o *UpdateServerPayload) SetMetadata(v UpdateServerPayloadGetMetadataRetType) {
setUpdateServerPayloadGetMetadataAttributeType(&o.Metadata, v)
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *UpdateServerPayload) GetName() (res UpdateServerPayloadGetNameRetType) {
res, _ = o.GetNameOk()
return
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateServerPayload) GetNameOk() (ret UpdateServerPayloadGetNameRetType, ok bool) {
return getUpdateServerPayloadGetNameAttributeTypeOk(o.Name)
}
// HasName returns a boolean if a field has been set.
func (o *UpdateServerPayload) HasName() bool {
_, ok := o.GetNameOk()
return ok
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *UpdateServerPayload) SetName(v UpdateServerPayloadGetNameRetType) {
setUpdateServerPayloadGetNameAttributeType(&o.Name, v)
}
func (o UpdateServerPayload) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getUpdateServerPayloadGetLabelsAttributeTypeOk(o.Labels); ok {
toSerialize["Labels"] = val
}
if val, ok := getUpdateServerPayloadGetMetadataAttributeTypeOk(o.Metadata); ok {
toSerialize["Metadata"] = val
}
if val, ok := getUpdateServerPayloadGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
return toSerialize, nil
}
type NullableUpdateServerPayload struct {
value *UpdateServerPayload
isSet bool
}
func (v NullableUpdateServerPayload) Get() *UpdateServerPayload {
return v.value
}
func (v *NullableUpdateServerPayload) Set(val *UpdateServerPayload) {
v.value = val
v.isSet = true
}
func (v NullableUpdateServerPayload) IsSet() bool {
return v.isSet
}
func (v *NullableUpdateServerPayload) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUpdateServerPayload(val *UpdateServerPayload) *NullableUpdateServerPayload {
return &NullableUpdateServerPayload{value: val, isSet: true}
}
func (v NullableUpdateServerPayload) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUpdateServerPayload) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}