113 lines
2.7 KiB
Go
113 lines
2.7 KiB
Go
/*
|
|
STACKIT MSSQL Service API
|
|
|
|
This is the documentation for the STACKIT MSSQL service
|
|
|
|
API version: 3alpha1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package sqlserverflexalpha
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
// InstanceVersionOpt the model 'InstanceVersionOpt'
|
|
type InstanceVersionOpt string
|
|
|
|
// List of instance.version.opt
|
|
const (
|
|
INSTANCEVERSIONOPT__2022 InstanceVersionOpt = "2022"
|
|
)
|
|
|
|
// All allowed values of InstanceVersionOpt enum
|
|
var AllowedInstanceVersionOptEnumValues = []InstanceVersionOpt{
|
|
"2022",
|
|
}
|
|
|
|
func (v *InstanceVersionOpt) UnmarshalJSON(src []byte) error {
|
|
var value string
|
|
err := json.Unmarshal(src, &value)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Allow unmarshalling zero value for testing purposes
|
|
var zeroValue string
|
|
if value == zeroValue {
|
|
return nil
|
|
}
|
|
enumTypeValue := InstanceVersionOpt(value)
|
|
for _, existing := range AllowedInstanceVersionOptEnumValues {
|
|
if existing == enumTypeValue {
|
|
*v = enumTypeValue
|
|
return nil
|
|
}
|
|
}
|
|
|
|
return fmt.Errorf("%+v is not a valid InstanceVersionOpt", value)
|
|
}
|
|
|
|
// NewInstanceVersionOptFromValue returns a pointer to a valid InstanceVersionOpt
|
|
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
|
func NewInstanceVersionOptFromValue(v string) (*InstanceVersionOpt, error) {
|
|
ev := InstanceVersionOpt(v)
|
|
if ev.IsValid() {
|
|
return &ev, nil
|
|
} else {
|
|
return nil, fmt.Errorf("invalid value '%v' for InstanceVersionOpt: valid values are %v", v, AllowedInstanceVersionOptEnumValues)
|
|
}
|
|
}
|
|
|
|
// IsValid return true if the value is valid for the enum, false otherwise
|
|
func (v InstanceVersionOpt) IsValid() bool {
|
|
for _, existing := range AllowedInstanceVersionOptEnumValues {
|
|
if existing == v {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// Ptr returns reference to instance.version.opt value
|
|
func (v InstanceVersionOpt) Ptr() *InstanceVersionOpt {
|
|
return &v
|
|
}
|
|
|
|
type NullableInstanceVersionOpt struct {
|
|
value *InstanceVersionOpt
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableInstanceVersionOpt) Get() *InstanceVersionOpt {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableInstanceVersionOpt) Set(val *InstanceVersionOpt) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableInstanceVersionOpt) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableInstanceVersionOpt) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableInstanceVersionOpt(val *InstanceVersionOpt) *NullableInstanceVersionOpt {
|
|
return &NullableInstanceVersionOpt{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableInstanceVersionOpt) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableInstanceVersionOpt) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|