## Description
<!-- **Please link some issue here describing what you are trying to achieve.**
In case there is no issue present for your PR, please consider creating one.
At least please give us some description what you are trying to achieve and why your change is needed. -->
relates to #1234
## Checklist
- [ ] Issue was linked above
- [ ] Code format was applied: `make fmt`
- [ ] Examples were added / adjusted (see `examples/` directory)
- [x] Docs are up-to-date: `make generate-docs` (will be checked by CI)
- [ ] Unit tests got implemented or updated
- [ ] Acceptance tests got implemented or updated (see e.g. [here](f5f99d1709/stackit/internal/services/dns/dns_acc_test.go))
- [x] Unit tests are passing: `make test` (will be checked by CI)
- [x] No linter issues: `make lint` (will be checked by CI)
Reviewed-on: #4
Reviewed-by: Andre_Harms <andre.harms@stackit.cloud>
Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
Co-committed-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
321 lines
11 KiB
Go
321 lines
11 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 ServerBootVolume type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ServerBootVolume{}
|
|
|
|
/*
|
|
types and functions for deleteOnTermination
|
|
*/
|
|
|
|
// isBoolean
|
|
type ServerBootVolumegetDeleteOnTerminationAttributeType = *bool
|
|
type ServerBootVolumegetDeleteOnTerminationArgType = bool
|
|
type ServerBootVolumegetDeleteOnTerminationRetType = bool
|
|
|
|
func getServerBootVolumegetDeleteOnTerminationAttributeTypeOk(arg ServerBootVolumegetDeleteOnTerminationAttributeType) (ret ServerBootVolumegetDeleteOnTerminationRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setServerBootVolumegetDeleteOnTerminationAttributeType(arg *ServerBootVolumegetDeleteOnTerminationAttributeType, val ServerBootVolumegetDeleteOnTerminationRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for id
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type ServerBootVolumeGetIdAttributeType = *string
|
|
|
|
func getServerBootVolumeGetIdAttributeTypeOk(arg ServerBootVolumeGetIdAttributeType) (ret ServerBootVolumeGetIdRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setServerBootVolumeGetIdAttributeType(arg *ServerBootVolumeGetIdAttributeType, val ServerBootVolumeGetIdRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type ServerBootVolumeGetIdArgType = string
|
|
type ServerBootVolumeGetIdRetType = string
|
|
|
|
/*
|
|
types and functions for performanceClass
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type ServerBootVolumeGetPerformanceClassAttributeType = *string
|
|
|
|
func getServerBootVolumeGetPerformanceClassAttributeTypeOk(arg ServerBootVolumeGetPerformanceClassAttributeType) (ret ServerBootVolumeGetPerformanceClassRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setServerBootVolumeGetPerformanceClassAttributeType(arg *ServerBootVolumeGetPerformanceClassAttributeType, val ServerBootVolumeGetPerformanceClassRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type ServerBootVolumeGetPerformanceClassArgType = string
|
|
type ServerBootVolumeGetPerformanceClassRetType = string
|
|
|
|
/*
|
|
types and functions for size
|
|
*/
|
|
|
|
// isLong
|
|
type ServerBootVolumeGetSizeAttributeType = *int64
|
|
type ServerBootVolumeGetSizeArgType = int64
|
|
type ServerBootVolumeGetSizeRetType = int64
|
|
|
|
func getServerBootVolumeGetSizeAttributeTypeOk(arg ServerBootVolumeGetSizeAttributeType) (ret ServerBootVolumeGetSizeRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setServerBootVolumeGetSizeAttributeType(arg *ServerBootVolumeGetSizeAttributeType, val ServerBootVolumeGetSizeRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for source
|
|
*/
|
|
|
|
// isModel
|
|
type ServerBootVolumeGetSourceAttributeType = *BootVolumeSource
|
|
type ServerBootVolumeGetSourceArgType = BootVolumeSource
|
|
type ServerBootVolumeGetSourceRetType = BootVolumeSource
|
|
|
|
func getServerBootVolumeGetSourceAttributeTypeOk(arg ServerBootVolumeGetSourceAttributeType) (ret ServerBootVolumeGetSourceRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setServerBootVolumeGetSourceAttributeType(arg *ServerBootVolumeGetSourceAttributeType, val ServerBootVolumeGetSourceRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
// ServerBootVolume struct for ServerBootVolume
|
|
type ServerBootVolume struct {
|
|
// Delete the volume during the termination of the server. Defaults to false.
|
|
DeleteOnTermination ServerBootVolumegetDeleteOnTerminationAttributeType `json:"deleteOnTermination,omitempty"`
|
|
// Universally Unique Identifier (UUID).
|
|
Id ServerBootVolumeGetIdAttributeType `json:"id,omitempty"`
|
|
// The name for a General Object. Matches Names and also UUIDs.
|
|
PerformanceClass ServerBootVolumeGetPerformanceClassAttributeType `json:"performanceClass,omitempty"`
|
|
// Size in Gigabyte.
|
|
Size ServerBootVolumeGetSizeAttributeType `json:"size,omitempty"`
|
|
Source ServerBootVolumeGetSourceAttributeType `json:"source,omitempty"`
|
|
}
|
|
|
|
// NewServerBootVolume instantiates a new ServerBootVolume 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 NewServerBootVolume() *ServerBootVolume {
|
|
this := ServerBootVolume{}
|
|
return &this
|
|
}
|
|
|
|
// NewServerBootVolumeWithDefaults instantiates a new ServerBootVolume 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 NewServerBootVolumeWithDefaults() *ServerBootVolume {
|
|
this := ServerBootVolume{}
|
|
return &this
|
|
}
|
|
|
|
// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise.
|
|
func (o *ServerBootVolume) GetDeleteOnTermination() (res ServerBootVolumegetDeleteOnTerminationRetType) {
|
|
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 *ServerBootVolume) GetDeleteOnTerminationOk() (ret ServerBootVolumegetDeleteOnTerminationRetType, ok bool) {
|
|
return getServerBootVolumegetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination)
|
|
}
|
|
|
|
// HasDeleteOnTermination returns a boolean if a field has been set.
|
|
func (o *ServerBootVolume) HasDeleteOnTermination() bool {
|
|
_, ok := o.GetDeleteOnTerminationOk()
|
|
return ok
|
|
}
|
|
|
|
// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field.
|
|
func (o *ServerBootVolume) SetDeleteOnTermination(v ServerBootVolumegetDeleteOnTerminationRetType) {
|
|
setServerBootVolumegetDeleteOnTerminationAttributeType(&o.DeleteOnTermination, v)
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *ServerBootVolume) GetId() (res ServerBootVolumeGetIdRetType) {
|
|
res, _ = o.GetIdOk()
|
|
return
|
|
}
|
|
|
|
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ServerBootVolume) GetIdOk() (ret ServerBootVolumeGetIdRetType, ok bool) {
|
|
return getServerBootVolumeGetIdAttributeTypeOk(o.Id)
|
|
}
|
|
|
|
// HasId returns a boolean if a field has been set.
|
|
func (o *ServerBootVolume) HasId() bool {
|
|
_, ok := o.GetIdOk()
|
|
return ok
|
|
}
|
|
|
|
// SetId gets a reference to the given string and assigns it to the Id field.
|
|
func (o *ServerBootVolume) SetId(v ServerBootVolumeGetIdRetType) {
|
|
setServerBootVolumeGetIdAttributeType(&o.Id, v)
|
|
}
|
|
|
|
// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise.
|
|
func (o *ServerBootVolume) GetPerformanceClass() (res ServerBootVolumeGetPerformanceClassRetType) {
|
|
res, _ = o.GetPerformanceClassOk()
|
|
return
|
|
}
|
|
|
|
// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ServerBootVolume) GetPerformanceClassOk() (ret ServerBootVolumeGetPerformanceClassRetType, ok bool) {
|
|
return getServerBootVolumeGetPerformanceClassAttributeTypeOk(o.PerformanceClass)
|
|
}
|
|
|
|
// HasPerformanceClass returns a boolean if a field has been set.
|
|
func (o *ServerBootVolume) HasPerformanceClass() bool {
|
|
_, ok := o.GetPerformanceClassOk()
|
|
return ok
|
|
}
|
|
|
|
// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field.
|
|
func (o *ServerBootVolume) SetPerformanceClass(v ServerBootVolumeGetPerformanceClassRetType) {
|
|
setServerBootVolumeGetPerformanceClassAttributeType(&o.PerformanceClass, v)
|
|
}
|
|
|
|
// GetSize returns the Size field value if set, zero value otherwise.
|
|
func (o *ServerBootVolume) GetSize() (res ServerBootVolumeGetSizeRetType) {
|
|
res, _ = o.GetSizeOk()
|
|
return
|
|
}
|
|
|
|
// GetSizeOk returns a tuple with the Size field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ServerBootVolume) GetSizeOk() (ret ServerBootVolumeGetSizeRetType, ok bool) {
|
|
return getServerBootVolumeGetSizeAttributeTypeOk(o.Size)
|
|
}
|
|
|
|
// HasSize returns a boolean if a field has been set.
|
|
func (o *ServerBootVolume) HasSize() bool {
|
|
_, ok := o.GetSizeOk()
|
|
return ok
|
|
}
|
|
|
|
// SetSize gets a reference to the given int64 and assigns it to the Size field.
|
|
func (o *ServerBootVolume) SetSize(v ServerBootVolumeGetSizeRetType) {
|
|
setServerBootVolumeGetSizeAttributeType(&o.Size, v)
|
|
}
|
|
|
|
// GetSource returns the Source field value if set, zero value otherwise.
|
|
func (o *ServerBootVolume) GetSource() (res ServerBootVolumeGetSourceRetType) {
|
|
res, _ = o.GetSourceOk()
|
|
return
|
|
}
|
|
|
|
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ServerBootVolume) GetSourceOk() (ret ServerBootVolumeGetSourceRetType, ok bool) {
|
|
return getServerBootVolumeGetSourceAttributeTypeOk(o.Source)
|
|
}
|
|
|
|
// HasSource returns a boolean if a field has been set.
|
|
func (o *ServerBootVolume) HasSource() bool {
|
|
_, ok := o.GetSourceOk()
|
|
return ok
|
|
}
|
|
|
|
// SetSource gets a reference to the given BootVolumeSource and assigns it to the Source field.
|
|
func (o *ServerBootVolume) SetSource(v ServerBootVolumeGetSourceRetType) {
|
|
setServerBootVolumeGetSourceAttributeType(&o.Source, v)
|
|
}
|
|
|
|
func (o ServerBootVolume) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getServerBootVolumegetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination); ok {
|
|
toSerialize["DeleteOnTermination"] = val
|
|
}
|
|
if val, ok := getServerBootVolumeGetIdAttributeTypeOk(o.Id); ok {
|
|
toSerialize["Id"] = val
|
|
}
|
|
if val, ok := getServerBootVolumeGetPerformanceClassAttributeTypeOk(o.PerformanceClass); ok {
|
|
toSerialize["PerformanceClass"] = val
|
|
}
|
|
if val, ok := getServerBootVolumeGetSizeAttributeTypeOk(o.Size); ok {
|
|
toSerialize["Size"] = val
|
|
}
|
|
if val, ok := getServerBootVolumeGetSourceAttributeTypeOk(o.Source); ok {
|
|
toSerialize["Source"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableServerBootVolume struct {
|
|
value *ServerBootVolume
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableServerBootVolume) Get() *ServerBootVolume {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableServerBootVolume) Set(val *ServerBootVolume) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableServerBootVolume) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableServerBootVolume) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableServerBootVolume(val *ServerBootVolume) *NullableServerBootVolume {
|
|
return &NullableServerBootVolume{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableServerBootVolume) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableServerBootVolume) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|