Skip to content

The micro-VM for AI agents — light enough to embed on your laptop, elastic enough to power an agentic cloud.

2.8 KB
Raw Blame
/*
BoxLite

BoxLite AI platform API Docs

API version: 1.0
Contact: [email protected]
*/

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

package apiclient

import (
	"encoding/json"
)

// BoxState The state of the box
type BoxState string

// List of BoxState
const (
	BOXSTATE_CREATING BoxState = "creating"
	BOXSTATE_RESTORING BoxState = "restoring"
	BOXSTATE_DESTROYED BoxState = "destroyed"
	BOXSTATE_DESTROYING BoxState = "destroying"
	BOXSTATE_STARTED BoxState = "started"
	BOXSTATE_STOPPED BoxState = "stopped"
	BOXSTATE_STARTING BoxState = "starting"
	BOXSTATE_STOPPING BoxState = "stopping"
	BOXSTATE_ERROR BoxState = "error"
	BOXSTATE_UNKNOWN BoxState = "unknown"
	BOXSTATE_ARCHIVED BoxState = "archived"
	BOXSTATE_ARCHIVING BoxState = "archiving"
	BOXSTATE_RESIZING BoxState = "resizing"
	BOXSTATE_UNKNOWN_DEFAULT_OPEN_API BoxState = "unknown_default_open_api"
)

// All allowed values of BoxState enum
var AllowedBoxStateEnumValues = []BoxState{
	"creating",
	"restoring",
	"destroyed",
	"destroying",
	"started",
	"stopped",
	"starting",
	"stopping",
	"error",
	"unknown",
	"archived",
	"archiving",
	"resizing",
	"unknown_default_open_api",
}

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

	*v = BOXSTATE_UNKNOWN_DEFAULT_OPEN_API
	return nil
}

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

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

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

type NullableBoxState struct {
	value *BoxState
	isSet bool
}

func (v NullableBoxState) Get() *BoxState {
	return v.value
}

func (v *NullableBoxState) Set(val *BoxState) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableBoxState(val *BoxState) *NullableBoxState {
	return &NullableBoxState{value: val, isSet: true}
}

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

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