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
96 lines
2.1 KiB
Go
96 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"
|
|
)
|
|
|
|
// TaskState the model 'TaskState'
|
|
type TaskState string
|
|
|
|
// List of TaskState
|
|
const (
|
|
TASKSTATE_NEW TaskState = "New"
|
|
TASKSTATE_STARTING TaskState = "Starting"
|
|
TASKSTATE_RUNNING TaskState = "Running"
|
|
TASKSTATE_SUSPENDED TaskState = "Suspended"
|
|
TASKSTATE_INTERRUPTED TaskState = "Interrupted"
|
|
TASKSTATE_PENDING TaskState = "Pending"
|
|
TASKSTATE_STOPPING TaskState = "Stopping"
|
|
TASKSTATE_COMPLETED TaskState = "Completed"
|
|
TASKSTATE_KILLED TaskState = "Killed"
|
|
TASKSTATE_EXCEPTION TaskState = "Exception"
|
|
TASKSTATE_SERVICE TaskState = "Service"
|
|
TASKSTATE_CANCELLING TaskState = "Cancelling"
|
|
TASKSTATE_CANCELLED TaskState = "Cancelled"
|
|
)
|
|
|
|
func (v *TaskState) UnmarshalJSON(src []byte) error {
|
|
var value string
|
|
err := json.Unmarshal(src, &value)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
enumTypeValue := TaskState(value)
|
|
for _, existing := range []TaskState{ "New", "Starting", "Running", "Suspended", "Interrupted", "Pending", "Stopping", "Completed", "Killed", "Exception", "Service", "Cancelling", "Cancelled", } {
|
|
if existing == enumTypeValue {
|
|
*v = enumTypeValue
|
|
return nil
|
|
}
|
|
}
|
|
|
|
return fmt.Errorf("%+v is not a valid TaskState", value)
|
|
}
|
|
|
|
// Ptr returns reference to TaskState value
|
|
func (v TaskState) Ptr() *TaskState {
|
|
return &v
|
|
}
|
|
|
|
type NullableTaskState struct {
|
|
value *TaskState
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableTaskState) Get() *TaskState {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableTaskState) Set(val *TaskState) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableTaskState) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableTaskState) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableTaskState(val *TaskState) *NullableTaskState {
|
|
return &NullableTaskState{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableTaskState) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableTaskState) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|
|
|