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

226 lines
7.5 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 VolumeAttachment type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &VolumeAttachment{}
/*
types and functions for deleteOnTermination
*/
// isBoolean
type VolumeAttachmentgetDeleteOnTerminationAttributeType = *bool
type VolumeAttachmentgetDeleteOnTerminationArgType = bool
type VolumeAttachmentgetDeleteOnTerminationRetType = bool
func getVolumeAttachmentgetDeleteOnTerminationAttributeTypeOk(arg VolumeAttachmentgetDeleteOnTerminationAttributeType) (ret VolumeAttachmentgetDeleteOnTerminationRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setVolumeAttachmentgetDeleteOnTerminationAttributeType(arg *VolumeAttachmentgetDeleteOnTerminationAttributeType, val VolumeAttachmentgetDeleteOnTerminationRetType) {
*arg = &val
}
/*
types and functions for serverId
*/
// isNotNullableString
type VolumeAttachmentGetServerIdAttributeType = *string
func getVolumeAttachmentGetServerIdAttributeTypeOk(arg VolumeAttachmentGetServerIdAttributeType) (ret VolumeAttachmentGetServerIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setVolumeAttachmentGetServerIdAttributeType(arg *VolumeAttachmentGetServerIdAttributeType, val VolumeAttachmentGetServerIdRetType) {
*arg = &val
}
type VolumeAttachmentGetServerIdArgType = string
type VolumeAttachmentGetServerIdRetType = string
/*
types and functions for volumeId
*/
// isNotNullableString
type VolumeAttachmentGetVolumeIdAttributeType = *string
func getVolumeAttachmentGetVolumeIdAttributeTypeOk(arg VolumeAttachmentGetVolumeIdAttributeType) (ret VolumeAttachmentGetVolumeIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setVolumeAttachmentGetVolumeIdAttributeType(arg *VolumeAttachmentGetVolumeIdAttributeType, val VolumeAttachmentGetVolumeIdRetType) {
*arg = &val
}
type VolumeAttachmentGetVolumeIdArgType = string
type VolumeAttachmentGetVolumeIdRetType = string
// VolumeAttachment Object that represents a Volume attachment to a server.
type VolumeAttachment struct {
// Delete the volume during the termination of the server. Defaults to false.
DeleteOnTermination VolumeAttachmentgetDeleteOnTerminationAttributeType `json:"deleteOnTermination,omitempty"`
// Universally Unique Identifier (UUID).
ServerId VolumeAttachmentGetServerIdAttributeType `json:"serverId,omitempty"`
// Universally Unique Identifier (UUID).
VolumeId VolumeAttachmentGetVolumeIdAttributeType `json:"volumeId,omitempty"`
}
// NewVolumeAttachment instantiates a new VolumeAttachment 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 NewVolumeAttachment() *VolumeAttachment {
this := VolumeAttachment{}
return &this
}
// NewVolumeAttachmentWithDefaults instantiates a new VolumeAttachment 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 NewVolumeAttachmentWithDefaults() *VolumeAttachment {
this := VolumeAttachment{}
return &this
}
// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise.
func (o *VolumeAttachment) GetDeleteOnTermination() (res VolumeAttachmentgetDeleteOnTerminationRetType) {
res, _ = o.GetDeleteOnTerminationOk()
return
}
// GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VolumeAttachment) GetDeleteOnTerminationOk() (ret VolumeAttachmentgetDeleteOnTerminationRetType, ok bool) {
return getVolumeAttachmentgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination)
}
// HasDeleteOnTermination returns a boolean if a field has been set.
func (o *VolumeAttachment) HasDeleteOnTermination() bool {
_, ok := o.GetDeleteOnTerminationOk()
return ok
}
// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field.
func (o *VolumeAttachment) SetDeleteOnTermination(v VolumeAttachmentgetDeleteOnTerminationRetType) {
setVolumeAttachmentgetDeleteOnTerminationAttributeType(&o.DeleteOnTermination, v)
}
// GetServerId returns the ServerId field value if set, zero value otherwise.
func (o *VolumeAttachment) GetServerId() (res VolumeAttachmentGetServerIdRetType) {
res, _ = o.GetServerIdOk()
return
}
// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VolumeAttachment) GetServerIdOk() (ret VolumeAttachmentGetServerIdRetType, ok bool) {
return getVolumeAttachmentGetServerIdAttributeTypeOk(o.ServerId)
}
// HasServerId returns a boolean if a field has been set.
func (o *VolumeAttachment) HasServerId() bool {
_, ok := o.GetServerIdOk()
return ok
}
// SetServerId gets a reference to the given string and assigns it to the ServerId field.
func (o *VolumeAttachment) SetServerId(v VolumeAttachmentGetServerIdRetType) {
setVolumeAttachmentGetServerIdAttributeType(&o.ServerId, v)
}
// GetVolumeId returns the VolumeId field value if set, zero value otherwise.
func (o *VolumeAttachment) GetVolumeId() (res VolumeAttachmentGetVolumeIdRetType) {
res, _ = o.GetVolumeIdOk()
return
}
// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *VolumeAttachment) GetVolumeIdOk() (ret VolumeAttachmentGetVolumeIdRetType, ok bool) {
return getVolumeAttachmentGetVolumeIdAttributeTypeOk(o.VolumeId)
}
// HasVolumeId returns a boolean if a field has been set.
func (o *VolumeAttachment) HasVolumeId() bool {
_, ok := o.GetVolumeIdOk()
return ok
}
// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field.
func (o *VolumeAttachment) SetVolumeId(v VolumeAttachmentGetVolumeIdRetType) {
setVolumeAttachmentGetVolumeIdAttributeType(&o.VolumeId, v)
}
func (o VolumeAttachment) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getVolumeAttachmentgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination); ok {
toSerialize["DeleteOnTermination"] = val
}
if val, ok := getVolumeAttachmentGetServerIdAttributeTypeOk(o.ServerId); ok {
toSerialize["ServerId"] = val
}
if val, ok := getVolumeAttachmentGetVolumeIdAttributeTypeOk(o.VolumeId); ok {
toSerialize["VolumeId"] = val
}
return toSerialize, nil
}
type NullableVolumeAttachment struct {
value *VolumeAttachment
isSet bool
}
func (v NullableVolumeAttachment) Get() *VolumeAttachment {
return v.value
}
func (v *NullableVolumeAttachment) Set(val *VolumeAttachment) {
v.value = val
v.isSet = true
}
func (v NullableVolumeAttachment) IsSet() bool {
return v.isSet
}
func (v *NullableVolumeAttachment) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableVolumeAttachment(val *VolumeAttachment) *NullableVolumeAttachment {
return &NullableVolumeAttachment{value: val, isSet: true}
}
func (v NullableVolumeAttachment) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableVolumeAttachment) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}