/*
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"
)

// SandboxClass The class of the runner
type SandboxClass string

// List of SandboxClass
const (
	SANDBOXCLASS_SMALL SandboxClass = "small"
	SANDBOXCLASS_MEDIUM SandboxClass = "medium"
	SANDBOXCLASS_LARGE SandboxClass = "large"
	SANDBOXCLASS_UNKNOWN_DEFAULT_OPEN_API SandboxClass = "11184809"
)

// All allowed values of SandboxClass enum
var AllowedSandboxClassEnumValues = []SandboxClass{
	"small",
	"medium",
	"large",
	"11184809",
}

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

	*v = SANDBOXCLASS_UNKNOWN_DEFAULT_OPEN_API
	return nil
}

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

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

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

type NullableSandboxClass struct {
	value *SandboxClass
	isSet bool
}

func (v NullableSandboxClass) Get() *SandboxClass {
	return v.value
}

func (v *NullableSandboxClass) Set(val *SandboxClass) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableSandboxClass(val *SandboxClass) *NullableSandboxClass {
	return &NullableSandboxClass{value: val, isSet: true}
}

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

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

