/* 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 UpdateVolumePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateVolumePayload{} /* types and functions for bootable */ // isBoolean type UpdateVolumePayloadgetBootableAttributeType = *bool type UpdateVolumePayloadgetBootableArgType = bool type UpdateVolumePayloadgetBootableRetType = bool func getUpdateVolumePayloadgetBootableAttributeTypeOk(arg UpdateVolumePayloadgetBootableAttributeType) (ret UpdateVolumePayloadgetBootableRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setUpdateVolumePayloadgetBootableAttributeType(arg *UpdateVolumePayloadgetBootableAttributeType, val UpdateVolumePayloadgetBootableRetType) { *arg = &val } /* types and functions for description */ // isNotNullableString type UpdateVolumePayloadGetDescriptionAttributeType = *string func getUpdateVolumePayloadGetDescriptionAttributeTypeOk(arg UpdateVolumePayloadGetDescriptionAttributeType) (ret UpdateVolumePayloadGetDescriptionRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setUpdateVolumePayloadGetDescriptionAttributeType(arg *UpdateVolumePayloadGetDescriptionAttributeType, val UpdateVolumePayloadGetDescriptionRetType) { *arg = &val } type UpdateVolumePayloadGetDescriptionArgType = string type UpdateVolumePayloadGetDescriptionRetType = string /* types and functions for imageConfig */ // isModel type UpdateVolumePayloadGetImageConfigAttributeType = *ImageConfig type UpdateVolumePayloadGetImageConfigArgType = ImageConfig type UpdateVolumePayloadGetImageConfigRetType = ImageConfig func getUpdateVolumePayloadGetImageConfigAttributeTypeOk(arg UpdateVolumePayloadGetImageConfigAttributeType) (ret UpdateVolumePayloadGetImageConfigRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setUpdateVolumePayloadGetImageConfigAttributeType(arg *UpdateVolumePayloadGetImageConfigAttributeType, val UpdateVolumePayloadGetImageConfigRetType) { *arg = &val } /* types and functions for labels */ // isFreeform type UpdateVolumePayloadGetLabelsAttributeType = *map[string]interface{} type UpdateVolumePayloadGetLabelsArgType = map[string]interface{} type UpdateVolumePayloadGetLabelsRetType = map[string]interface{} func getUpdateVolumePayloadGetLabelsAttributeTypeOk(arg UpdateVolumePayloadGetLabelsAttributeType) (ret UpdateVolumePayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setUpdateVolumePayloadGetLabelsAttributeType(arg *UpdateVolumePayloadGetLabelsAttributeType, val UpdateVolumePayloadGetLabelsRetType) { *arg = &val } /* types and functions for name */ // isNotNullableString type UpdateVolumePayloadGetNameAttributeType = *string func getUpdateVolumePayloadGetNameAttributeTypeOk(arg UpdateVolumePayloadGetNameAttributeType) (ret UpdateVolumePayloadGetNameRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setUpdateVolumePayloadGetNameAttributeType(arg *UpdateVolumePayloadGetNameAttributeType, val UpdateVolumePayloadGetNameRetType) { *arg = &val } type UpdateVolumePayloadGetNameArgType = string type UpdateVolumePayloadGetNameRetType = string // UpdateVolumePayload Object that represents an update request body of a volume. type UpdateVolumePayload struct { // Indicates if a volume is bootable. Bootable UpdateVolumePayloadgetBootableAttributeType `json:"bootable,omitempty"` // Description Object. Allows string up to 255 Characters. Description UpdateVolumePayloadGetDescriptionAttributeType `json:"description,omitempty"` ImageConfig UpdateVolumePayloadGetImageConfigAttributeType `json:"imageConfig,omitempty"` // 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 UpdateVolumePayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. Name UpdateVolumePayloadGetNameAttributeType `json:"name,omitempty"` } // NewUpdateVolumePayload instantiates a new UpdateVolumePayload 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 NewUpdateVolumePayload() *UpdateVolumePayload { this := UpdateVolumePayload{} return &this } // NewUpdateVolumePayloadWithDefaults instantiates a new UpdateVolumePayload 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 NewUpdateVolumePayloadWithDefaults() *UpdateVolumePayload { this := UpdateVolumePayload{} return &this } // GetBootable returns the Bootable field value if set, zero value otherwise. func (o *UpdateVolumePayload) GetBootable() (res UpdateVolumePayloadgetBootableRetType) { res, _ = o.GetBootableOk() return } // GetBootableOk returns a tuple with the Bootable field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UpdateVolumePayload) GetBootableOk() (ret UpdateVolumePayloadgetBootableRetType, ok bool) { return getUpdateVolumePayloadgetBootableAttributeTypeOk(o.Bootable) } // HasBootable returns a boolean if a field has been set. func (o *UpdateVolumePayload) HasBootable() bool { _, ok := o.GetBootableOk() return ok } // SetBootable gets a reference to the given bool and assigns it to the Bootable field. func (o *UpdateVolumePayload) SetBootable(v UpdateVolumePayloadgetBootableRetType) { setUpdateVolumePayloadgetBootableAttributeType(&o.Bootable, v) } // GetDescription returns the Description field value if set, zero value otherwise. func (o *UpdateVolumePayload) GetDescription() (res UpdateVolumePayloadGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return } // 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 *UpdateVolumePayload) GetDescriptionOk() (ret UpdateVolumePayloadGetDescriptionRetType, ok bool) { return getUpdateVolumePayloadGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. func (o *UpdateVolumePayload) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. func (o *UpdateVolumePayload) SetDescription(v UpdateVolumePayloadGetDescriptionRetType) { setUpdateVolumePayloadGetDescriptionAttributeType(&o.Description, v) } // GetImageConfig returns the ImageConfig field value if set, zero value otherwise. func (o *UpdateVolumePayload) GetImageConfig() (res UpdateVolumePayloadGetImageConfigRetType) { res, _ = o.GetImageConfigOk() return } // GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UpdateVolumePayload) GetImageConfigOk() (ret UpdateVolumePayloadGetImageConfigRetType, ok bool) { return getUpdateVolumePayloadGetImageConfigAttributeTypeOk(o.ImageConfig) } // HasImageConfig returns a boolean if a field has been set. func (o *UpdateVolumePayload) HasImageConfig() bool { _, ok := o.GetImageConfigOk() return ok } // SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. func (o *UpdateVolumePayload) SetImageConfig(v UpdateVolumePayloadGetImageConfigRetType) { setUpdateVolumePayloadGetImageConfigAttributeType(&o.ImageConfig, v) } // GetLabels returns the Labels field value if set, zero value otherwise. func (o *UpdateVolumePayload) GetLabels() (res UpdateVolumePayloadGetLabelsRetType) { 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 *UpdateVolumePayload) GetLabelsOk() (ret UpdateVolumePayloadGetLabelsRetType, ok bool) { return getUpdateVolumePayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. func (o *UpdateVolumePayload) 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 *UpdateVolumePayload) SetLabels(v UpdateVolumePayloadGetLabelsRetType) { setUpdateVolumePayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. func (o *UpdateVolumePayload) GetName() (res UpdateVolumePayloadGetNameRetType) { 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 *UpdateVolumePayload) GetNameOk() (ret UpdateVolumePayloadGetNameRetType, ok bool) { return getUpdateVolumePayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *UpdateVolumePayload) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. func (o *UpdateVolumePayload) SetName(v UpdateVolumePayloadGetNameRetType) { setUpdateVolumePayloadGetNameAttributeType(&o.Name, v) } func (o UpdateVolumePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateVolumePayloadgetBootableAttributeTypeOk(o.Bootable); ok { toSerialize["Bootable"] = val } if val, ok := getUpdateVolumePayloadGetDescriptionAttributeTypeOk(o.Description); ok { toSerialize["Description"] = val } if val, ok := getUpdateVolumePayloadGetImageConfigAttributeTypeOk(o.ImageConfig); ok { toSerialize["ImageConfig"] = val } if val, ok := getUpdateVolumePayloadGetLabelsAttributeTypeOk(o.Labels); ok { toSerialize["Labels"] = val } if val, ok := getUpdateVolumePayloadGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val } return toSerialize, nil } type NullableUpdateVolumePayload struct { value *UpdateVolumePayload isSet bool } func (v NullableUpdateVolumePayload) Get() *UpdateVolumePayload { return v.value } func (v *NullableUpdateVolumePayload) Set(val *UpdateVolumePayload) { v.value = val v.isSet = true } func (v NullableUpdateVolumePayload) IsSet() bool { return v.isSet } func (v *NullableUpdateVolumePayload) Unset() { v.value = nil v.isSet = false } func NewNullableUpdateVolumePayload(val *UpdateVolumePayload) *NullableUpdateVolumePayload { return &NullableUpdateVolumePayload{value: val, isSet: true} } func (v NullableUpdateVolumePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableUpdateVolumePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }