111 lines
2.6 KiB
Go
111 lines
2.6 KiB
Go
/*
|
|
Model Registry REST API
|
|
|
|
REST API for Model Registry to create and manage ML model metadata
|
|
|
|
API version: v1alpha3
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package openapi
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
// ExperimentState - LIVE: A state indicating that the `Experiment` exists - ARCHIVED: A state indicating that the `Experiment` has been archived.
|
|
type ExperimentState string
|
|
|
|
// List of ExperimentState
|
|
const (
|
|
EXPERIMENTSTATE_LIVE ExperimentState = "LIVE"
|
|
EXPERIMENTSTATE_ARCHIVED ExperimentState = "ARCHIVED"
|
|
)
|
|
|
|
// All allowed values of ExperimentState enum
|
|
var AllowedExperimentStateEnumValues = []ExperimentState{
|
|
"LIVE",
|
|
"ARCHIVED",
|
|
}
|
|
|
|
func (v *ExperimentState) UnmarshalJSON(src []byte) error {
|
|
var value string
|
|
err := json.Unmarshal(src, &value)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
enumTypeValue := ExperimentState(value)
|
|
for _, existing := range AllowedExperimentStateEnumValues {
|
|
if existing == enumTypeValue {
|
|
*v = enumTypeValue
|
|
return nil
|
|
}
|
|
}
|
|
|
|
return fmt.Errorf("%+v is not a valid ExperimentState", value)
|
|
}
|
|
|
|
// NewExperimentStateFromValue returns a pointer to a valid ExperimentState
|
|
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
|
func NewExperimentStateFromValue(v string) (*ExperimentState, error) {
|
|
ev := ExperimentState(v)
|
|
if ev.IsValid() {
|
|
return &ev, nil
|
|
} else {
|
|
return nil, fmt.Errorf("invalid value '%v' for ExperimentState: valid values are %v", v, AllowedExperimentStateEnumValues)
|
|
}
|
|
}
|
|
|
|
// IsValid return true if the value is valid for the enum, false otherwise
|
|
func (v ExperimentState) IsValid() bool {
|
|
for _, existing := range AllowedExperimentStateEnumValues {
|
|
if existing == v {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// Ptr returns reference to ExperimentState value
|
|
func (v ExperimentState) Ptr() *ExperimentState {
|
|
return &v
|
|
}
|
|
|
|
type NullableExperimentState struct {
|
|
value *ExperimentState
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableExperimentState) Get() *ExperimentState {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableExperimentState) Set(val *ExperimentState) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableExperimentState) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableExperimentState) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableExperimentState(val *ExperimentState) *NullableExperimentState {
|
|
return &NullableExperimentState{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableExperimentState) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableExperimentState) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|