/* * 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" ) // Health the model 'Health' type Health string // List of Health const ( HEALTH_OK Health = "OK" HEALTH_WARNING Health = "Warning" HEALTH_CRITICAL Health = "Critical" ) func (v *Health) UnmarshalJSON(src []byte) error { var value string err := json.Unmarshal(src, &value) if err != nil { return err } enumTypeValue := Health(value) for _, existing := range []Health{ "OK", "Warning", "Critical", } { if existing == enumTypeValue { *v = enumTypeValue return nil } } return fmt.Errorf("%+v is not a valid Health", value) } // Ptr returns reference to Health value func (v Health) Ptr() *Health { return &v } type NullableHealth struct { value *Health isSet bool } func (v NullableHealth) Get() *Health { return v.value } func (v *NullableHealth) Set(val *Health) { v.value = val v.isSet = true } func (v NullableHealth) IsSet() bool { return v.isSet } func (v *NullableHealth) Unset() { v.value = nil v.isSet = false } func NewNullableHealth(val *Health) *NullableHealth { return &NullableHealth{value: val, isSet: true} } func (v NullableHealth) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableHealth) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }