c442eb5bcb
Upgraded openapi generator version to 5.1.0 for the support of nullable values for optional fields; Added missing "Disabled" enum value to the BootSourceOverrideEnabled model in the openapi schema. Signed-off-by: James Gu <james.gu@att.com> Change-Id: Ia3e0b018be13079d2085ef61ed2e797bcfd25fd7
86 lines
2.1 KiB
Go
86 lines
2.1 KiB
Go
/*
|
|
* Redfish OAPI specification
|
|
*
|
|
* Partial Redfish OAPI specification for a limited client
|
|
*
|
|
* API version: 0.0.1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package client
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
// BootSourceOverrideEnabled the model 'BootSourceOverrideEnabled'
|
|
type BootSourceOverrideEnabled string
|
|
|
|
// List of BootSourceOverrideEnabled
|
|
const (
|
|
BOOTSOURCEOVERRIDEENABLED_ONCE BootSourceOverrideEnabled = "Once"
|
|
BOOTSOURCEOVERRIDEENABLED_CONTINUOUS BootSourceOverrideEnabled = "Continuous"
|
|
BOOTSOURCEOVERRIDEENABLED_DISABLED BootSourceOverrideEnabled = "Disabled"
|
|
)
|
|
|
|
func (v *BootSourceOverrideEnabled) UnmarshalJSON(src []byte) error {
|
|
var value string
|
|
err := json.Unmarshal(src, &value)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
enumTypeValue := BootSourceOverrideEnabled(value)
|
|
for _, existing := range []BootSourceOverrideEnabled{ "Once", "Continuous", "Disabled", } {
|
|
if existing == enumTypeValue {
|
|
*v = enumTypeValue
|
|
return nil
|
|
}
|
|
}
|
|
|
|
return fmt.Errorf("%+v is not a valid BootSourceOverrideEnabled", value)
|
|
}
|
|
|
|
// Ptr returns reference to BootSourceOverrideEnabled value
|
|
func (v BootSourceOverrideEnabled) Ptr() *BootSourceOverrideEnabled {
|
|
return &v
|
|
}
|
|
|
|
type NullableBootSourceOverrideEnabled struct {
|
|
value *BootSourceOverrideEnabled
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableBootSourceOverrideEnabled) Get() *BootSourceOverrideEnabled {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableBootSourceOverrideEnabled) Set(val *BootSourceOverrideEnabled) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableBootSourceOverrideEnabled) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableBootSourceOverrideEnabled) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableBootSourceOverrideEnabled(val *BootSourceOverrideEnabled) *NullableBootSourceOverrideEnabled {
|
|
return &NullableBootSourceOverrideEnabled{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableBootSourceOverrideEnabled) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableBootSourceOverrideEnabled) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|
|
|