/*
Daytona

Daytona AI platform API Docs

API version: 1.0
Contact: support@daytona.com
*/

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package apiclient

import (
	"encoding/json"
)

// RunnerClass The class of the runner
type RunnerClass string

// List of RunnerClass
const (
	RUNNERCLASS_CONTAINER RunnerClass = "container"
	RUNNERCLASS_VM RunnerClass = "vm"
	RUNNERCLASS_UNKNOWN_DEFAULT_OPEN_API RunnerClass = "11184809"
)

// All allowed values of RunnerClass enum
var AllowedRunnerClassEnumValues = []RunnerClass{
	"container",
	"vm",
	"11184809",
}

func (v *RunnerClass) UnmarshalJSON(src []byte) error {
	var value string
	err := json.Unmarshal(src, &value)
	if err != nil {
		return err
	}
	enumTypeValue := RunnerClass(value)
	for _, existing := range AllowedRunnerClassEnumValues {
		if existing == enumTypeValue {
			*v = enumTypeValue
			return nil
		}
	}

	*v = RUNNERCLASS_UNKNOWN_DEFAULT_OPEN_API
	return nil
}

// NewRunnerClassFromValue returns a pointer to a valid RunnerClass
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewRunnerClassFromValue(v string) (*RunnerClass, error) {
	ev := RunnerClass(v)
	if ev.IsValid() {
		return &ev, nil
	} else {
		enumValue := RUNNERCLASS_UNKNOWN_DEFAULT_OPEN_API
		return &enumValue, nil
	}
}

// IsValid return true if the value is valid for the enum, false otherwise
func (v RunnerClass) IsValid() bool {
	for _, existing := range AllowedRunnerClassEnumValues {
		if existing == v {
			return true
		}
	}
	return false
}

// Ptr returns reference to RunnerClass value
func (v RunnerClass) Ptr() *RunnerClass {
	return &v
}

type NullableRunnerClass struct {
	value *RunnerClass
	isSet bool
}

func (v NullableRunnerClass) Get() *RunnerClass {
	return v.value
}

func (v *NullableRunnerClass) Set(val *RunnerClass) {
	v.value = val
	v.isSet = true
}

func (v NullableRunnerClass) IsSet() bool {
	return v.isSet
}

func (v *NullableRunnerClass) Unset() {
	v.value = nil
	v.isSet = false
}

func NewNullableRunnerClass(val *RunnerClass) *NullableRunnerClass {
	return &NullableRunnerClass{value: val, isSet: true}
}

func (v NullableRunnerClass) MarshalJSON() ([]byte, error) {
	return json.Marshal(v.value)
}

func (v *NullableRunnerClass) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}

