Skip to content

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

29.3 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"
	"fmt"
)

// checks if the Box type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Box{}

// Box struct for Box
type Box struct {
	// The public 12-character Box ID
	Id string `json:"id"`
	// The organization ID of the box
	OrganizationId string `json:"organizationId"`
	// The name of the box
	Name string `json:"name"`
	// The user associated with the project
	User string `json:"user"`
	// Environment variables for the box
	Env map[string]string `json:"env"`
	// Labels for the box
	Labels map[string]string `json:"labels"`
	// The network policy in both directions
	Network *NetworkInfo `json:"network,omitempty"`
	// The target environment for the box
	Target string `json:"target"`
	// The image used for the box
	Image *string `json:"image,omitempty"`
	// The CPU quota for the box
	Cpu float32 `json:"cpu"`
	// The GPU quota for the box
	Gpu float32 `json:"gpu"`
	// The memory quota for the box
	Memory float32 `json:"memory"`
	// The disk quota for the box
	Disk float32 `json:"disk"`
	// Persisted guest privilege mode; absent when an older server does not report it
	Privileged *bool `json:"privileged,omitempty"`
	// The state of the box
	State *BoxState `json:"state,omitempty"`
	// The desired state of the box
	DesiredState *BoxDesiredState `json:"desiredState,omitempty"`
	// The error reason of the box
	ErrorReason *string `json:"errorReason,omitempty"`
	// Whether the box error is recoverable.
	Recoverable *bool `json:"recoverable,omitempty"`
	// Auto-stop interval in seconds (0 means disabled)
	AutoStop *int32 `json:"autoStop,omitempty"`
	// Auto-delete interval in seconds (0 means disabled)
	AutoDelete *int32 `json:"autoDelete,omitempty"`
	// Whether the box should be automatically resumed on proxy access
	AutoResume *bool `json:"autoResume,omitempty"`
	// Array of volumes attached to the box
	Volumes []BoxVolume `json:"volumes,omitempty"`
	// The creation timestamp of the box
	CreatedAt *string `json:"createdAt,omitempty"`
	// The last update timestamp of the box
	UpdatedAt *string `json:"updatedAt,omitempty"`
	// The timestamp of the last recorded activity on the box, absent when no activity has been recorded yet
	LastActivityAt *string `json:"lastActivityAt,omitempty"`
	// How the box's main command ended, present once the box has stopped and the runtime recorded it: its own code when it exited, or `128 + n` when a signal ended it. Stopping a box signals that command, so a stop is recorded here too. `0` is a real value, so a client must tell the missing field from a zero one. Only reading a single box carries it: this schema is shared with the box list and with the replies that change a box, which leave it out whether or not one was recorded.
	ExitCode *int32 `json:"exitCode,omitempty"`
	// The class of the box
	// Deprecated
	Class *string `json:"class,omitempty"`
	// The version of the daemon running in the box
	DaemonVersion *string `json:"daemonVersion,omitempty"`
	// The runner ID of the box
	RunnerId *string `json:"runnerId,omitempty"`
	// What a box still being created is waiting on. Absent once it has started, and absent while it is being created from an image that has already been pulled
	Progress *BoxProgress `json:"progress,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _Box Box

// NewBox instantiates a new Box object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewBox(id string, organizationId string, name string, user string, env map[string]string, labels map[string]string, target string, cpu float32, gpu float32, memory float32, disk float32) *Box {
	this := Box{}
	this.Id = id
	this.OrganizationId = organizationId
	this.Name = name
	this.User = user
	this.Env = env
	this.Labels = labels
	this.Target = target
	this.Cpu = cpu
	this.Gpu = gpu
	this.Memory = memory
	this.Disk = disk
	return &this
}

// NewBoxWithDefaults instantiates a new Box object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewBoxWithDefaults() *Box {
	this := Box{}
	return &this
}

// GetId returns the Id field value
func (o *Box) GetId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Id
}

// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *Box) GetIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Id, true
}

// SetId sets field value
func (o *Box) SetId(v string) {
	o.Id = v
}

// GetOrganizationId returns the OrganizationId field value
func (o *Box) GetOrganizationId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.OrganizationId
}

// GetOrganizationIdOk returns a tuple with the OrganizationId field value
// and a boolean to check if the value has been set.
func (o *Box) GetOrganizationIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.OrganizationId, true
}

// SetOrganizationId sets field value
func (o *Box) SetOrganizationId(v string) {
	o.OrganizationId = v
}

// GetName returns the Name field value
func (o *Box) GetName() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Name
}

// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *Box) GetNameOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Name, true
}

// SetName sets field value
func (o *Box) SetName(v string) {
	o.Name = v
}

// GetUser returns the User field value
func (o *Box) GetUser() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.User
}

// GetUserOk returns a tuple with the User field value
// and a boolean to check if the value has been set.
func (o *Box) GetUserOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.User, true
}

// SetUser sets field value
func (o *Box) SetUser(v string) {
	o.User = v
}

// GetEnv returns the Env field value
func (o *Box) GetEnv() map[string]string {
	if o == nil {
		var ret map[string]string
		return ret
	}

	return o.Env
}

// GetEnvOk returns a tuple with the Env field value
// and a boolean to check if the value has been set.
func (o *Box) GetEnvOk() (*map[string]string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Env, true
}

// SetEnv sets field value
func (o *Box) SetEnv(v map[string]string) {
	o.Env = v
}

// GetLabels returns the Labels field value
func (o *Box) GetLabels() map[string]string {
	if o == nil {
		var ret map[string]string
		return ret
	}

	return o.Labels
}

// GetLabelsOk returns a tuple with the Labels field value
// and a boolean to check if the value has been set.
func (o *Box) GetLabelsOk() (*map[string]string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Labels, true
}

// SetLabels sets field value
func (o *Box) SetLabels(v map[string]string) {
	o.Labels = v
}

// GetNetwork returns the Network field value if set, zero value otherwise.
func (o *Box) GetNetwork() NetworkInfo {
	if o == nil || IsNil(o.Network) {
		var ret NetworkInfo
		return ret
	}
	return *o.Network
}

// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Box) GetNetworkOk() (*NetworkInfo, bool) {
	if o == nil || IsNil(o.Network) {
		return nil, false
	}
	return o.Network, true
}

// HasNetwork returns a boolean if a field has been set.
func (o *Box) HasNetwork() bool {
	if o != nil && !IsNil(o.Network) {
		return true
	}

	return false
}

// SetNetwork gets a reference to the given NetworkInfo and assigns it to the Network field.
func (o *Box) SetNetwork(v NetworkInfo) {
	o.Network = &v
}

// GetTarget returns the Target field value
func (o *Box) GetTarget() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Target
}

// GetTargetOk returns a tuple with the Target field value
// and a boolean to check if the value has been set.
func (o *Box) GetTargetOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Target, true
}

// SetTarget sets field value
func (o *Box) SetTarget(v string) {
	o.Target = v
}

// GetImage returns the Image field value if set, zero value otherwise.
func (o *Box) GetImage() string {
	if o == nil || IsNil(o.Image) {
		var ret string
		return ret
	}
	return *o.Image
}

// GetImageOk returns a tuple with the Image field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Box) GetImageOk() (*string, bool) {
	if o == nil || IsNil(o.Image) {
		return nil, false
	}
	return o.Image, true
}

// HasImage returns a boolean if a field has been set.
func (o *Box) HasImage() bool {
	if o != nil && !IsNil(o.Image) {
		return true
	}

	return false
}

// SetImage gets a reference to the given string and assigns it to the Image field.
func (o *Box) SetImage(v string) {
	o.Image = &v
}

// GetCpu returns the Cpu field value
func (o *Box) GetCpu() float32 {
	if o == nil {
		var ret float32
		return ret
	}

	return o.Cpu
}

// GetCpuOk returns a tuple with the Cpu field value
// and a boolean to check if the value has been set.
func (o *Box) GetCpuOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Cpu, true
}

// SetCpu sets field value
func (o *Box) SetCpu(v float32) {
	o.Cpu = v
}

// GetGpu returns the Gpu field value
func (o *Box) GetGpu() float32 {
	if o == nil {
		var ret float32
		return ret
	}

	return o.Gpu
}

// GetGpuOk returns a tuple with the Gpu field value
// and a boolean to check if the value has been set.
func (o *Box) GetGpuOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Gpu, true
}

// SetGpu sets field value
func (o *Box) SetGpu(v float32) {
	o.Gpu = v
}

// GetMemory returns the Memory field value
func (o *Box) GetMemory() float32 {
	if o == nil {
		var ret float32
		return ret
	}

	return o.Memory
}

// GetMemoryOk returns a tuple with the Memory field value
// and a boolean to check if the value has been set.
func (o *Box) GetMemoryOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Memory, true
}

// SetMemory sets field value
func (o *Box) SetMemory(v float32) {
	o.Memory = v
}

// GetDisk returns the Disk field value
func (o *Box) GetDisk() float32 {
	if o == nil {
		var ret float32
		return ret
	}

	return o.Disk
}

// GetDiskOk returns a tuple with the Disk field value
// and a boolean to check if the value has been set.
func (o *Box) GetDiskOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Disk, true
}

// SetDisk sets field value
func (o *Box) SetDisk(v float32) {
	o.Disk = v
}

// GetPrivileged returns the Privileged field value if set, zero value otherwise.
func (o *Box) GetPrivileged() bool {
	if o == nil || IsNil(o.Privileged) {
		var ret bool
		return ret
	}
	return *o.Privileged
}

// GetPrivilegedOk returns a tuple with the Privileged field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Box) GetPrivilegedOk() (*bool, bool) {
	if o == nil || IsNil(o.Privileged) {
		return nil, false
	}
	return o.Privileged, true
}

// HasPrivileged returns a boolean if a field has been set.
func (o *Box) HasPrivileged() bool {
	if o != nil && !IsNil(o.Privileged) {
		return true
	}

	return false
}

// SetPrivileged gets a reference to the given bool and assigns it to the Privileged field.
func (o *Box) SetPrivileged(v bool) {
	o.Privileged = &v
}

// GetState returns the State field value if set, zero value otherwise.
func (o *Box) GetState() BoxState {
	if o == nil || IsNil(o.State) {
		var ret BoxState
		return ret
	}
	return *o.State
}

// GetStateOk returns a tuple with the State field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Box) GetStateOk() (*BoxState, bool) {
	if o == nil || IsNil(o.State) {
		return nil, false
	}
	return o.State, true
}

// HasState returns a boolean if a field has been set.
func (o *Box) HasState() bool {
	if o != nil && !IsNil(o.State) {
		return true
	}

	return false
}

// SetState gets a reference to the given BoxState and assigns it to the State field.
func (o *Box) SetState(v BoxState) {
	o.State = &v
}

// GetDesiredState returns the DesiredState field value if set, zero value otherwise.
func (o *Box) GetDesiredState() BoxDesiredState {
	if o == nil || IsNil(o.DesiredState) {
		var ret BoxDesiredState
		return ret
	}
	return *o.DesiredState
}

// GetDesiredStateOk returns a tuple with the DesiredState field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Box) GetDesiredStateOk() (*BoxDesiredState, bool) {
	if o == nil || IsNil(o.DesiredState) {
		return nil, false
	}
	return o.DesiredState, true
}

// HasDesiredState returns a boolean if a field has been set.
func (o *Box) HasDesiredState() bool {
	if o != nil && !IsNil(o.DesiredState) {
		return true
	}

	return false
}

// SetDesiredState gets a reference to the given BoxDesiredState and assigns it to the DesiredState field.
func (o *Box) SetDesiredState(v BoxDesiredState) {
	o.DesiredState = &v
}

// GetErrorReason returns the ErrorReason field value if set, zero value otherwise.
func (o *Box) GetErrorReason() string {
	if o == nil || IsNil(o.ErrorReason) {
		var ret string
		return ret
	}
	return *o.ErrorReason
}

// GetErrorReasonOk returns a tuple with the ErrorReason field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Box) GetErrorReasonOk() (*string, bool) {
	if o == nil || IsNil(o.ErrorReason) {
		return nil, false
	}
	return o.ErrorReason, true
}

// HasErrorReason returns a boolean if a field has been set.
func (o *Box) HasErrorReason() bool {
	if o != nil && !IsNil(o.ErrorReason) {
		return true
	}

	return false
}

// SetErrorReason gets a reference to the given string and assigns it to the ErrorReason field.
func (o *Box) SetErrorReason(v string) {
	o.ErrorReason = &v
}

// GetRecoverable returns the Recoverable field value if set, zero value otherwise.
func (o *Box) GetRecoverable() bool {
	if o == nil || IsNil(o.Recoverable) {
		var ret bool
		return ret
	}
	return *o.Recoverable
}

// GetRecoverableOk returns a tuple with the Recoverable field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Box) GetRecoverableOk() (*bool, bool) {
	if o == nil || IsNil(o.Recoverable) {
		return nil, false
	}
	return o.Recoverable, true
}

// HasRecoverable returns a boolean if a field has been set.
func (o *Box) HasRecoverable() bool {
	if o != nil && !IsNil(o.Recoverable) {
		return true
	}

	return false
}

// SetRecoverable gets a reference to the given bool and assigns it to the Recoverable field.
func (o *Box) SetRecoverable(v bool) {
	o.Recoverable = &v
}

// GetAutoStop returns the AutoStop field value if set, zero value otherwise.
func (o *Box) GetAutoStop() int32 {
	if o == nil || IsNil(o.AutoStop) {
		var ret int32
		return ret
	}
	return *o.AutoStop
}

// GetAutoStopOk returns a tuple with the AutoStop field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Box) GetAutoStopOk() (*int32, bool) {
	if o == nil || IsNil(o.AutoStop) {
		return nil, false
	}
	return o.AutoStop, true
}

// HasAutoStop returns a boolean if a field has been set.
func (o *Box) HasAutoStop() bool {
	if o != nil && !IsNil(o.AutoStop) {
		return true
	}

	return false
}

// SetAutoStop gets a reference to the given int32 and assigns it to the AutoStop field.
func (o *Box) SetAutoStop(v int32) {
	o.AutoStop = &v
}

// GetAutoDelete returns the AutoDelete field value if set, zero value otherwise.
func (o *Box) GetAutoDelete() int32 {
	if o == nil || IsNil(o.AutoDelete) {
		var ret int32
		return ret
	}
	return *o.AutoDelete
}

// GetAutoDeleteOk returns a tuple with the AutoDelete field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Box) GetAutoDeleteOk() (*int32, bool) {
	if o == nil || IsNil(o.AutoDelete) {
		return nil, false
	}
	return o.AutoDelete, true
}

// HasAutoDelete returns a boolean if a field has been set.
func (o *Box) HasAutoDelete() bool {
	if o != nil && !IsNil(o.AutoDelete) {
		return true
	}

	return false
}

// SetAutoDelete gets a reference to the given int32 and assigns it to the AutoDelete field.
func (o *Box) SetAutoDelete(v int32) {
	o.AutoDelete = &v
}

// GetAutoResume returns the AutoResume field value if set, zero value otherwise.
func (o *Box) GetAutoResume() bool {
	if o == nil || IsNil(o.AutoResume) {
		var ret bool
		return ret
	}
	return *o.AutoResume
}

// GetAutoResumeOk returns a tuple with the AutoResume field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Box) GetAutoResumeOk() (*bool, bool) {
	if o == nil || IsNil(o.AutoResume) {
		return nil, false
	}
	return o.AutoResume, true
}

// HasAutoResume returns a boolean if a field has been set.
func (o *Box) HasAutoResume() bool {
	if o != nil && !IsNil(o.AutoResume) {
		return true
	}

	return false
}

// SetAutoResume gets a reference to the given bool and assigns it to the AutoResume field.
func (o *Box) SetAutoResume(v bool) {
	o.AutoResume = &v
}

// GetVolumes returns the Volumes field value if set, zero value otherwise.
func (o *Box) GetVolumes() []BoxVolume {
	if o == nil || IsNil(o.Volumes) {
		var ret []BoxVolume
		return ret
	}
	return o.Volumes
}

// GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Box) GetVolumesOk() ([]BoxVolume, bool) {
	if o == nil || IsNil(o.Volumes) {
		return nil, false
	}
	return o.Volumes, true
}

// HasVolumes returns a boolean if a field has been set.
func (o *Box) HasVolumes() bool {
	if o != nil && !IsNil(o.Volumes) {
		return true
	}

	return false
}

// SetVolumes gets a reference to the given []BoxVolume and assigns it to the Volumes field.
func (o *Box) SetVolumes(v []BoxVolume) {
	o.Volumes = v
}

// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *Box) GetCreatedAt() string {
	if o == nil || IsNil(o.CreatedAt) {
		var ret string
		return ret
	}
	return *o.CreatedAt
}

// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Box) GetCreatedAtOk() (*string, bool) {
	if o == nil || IsNil(o.CreatedAt) {
		return nil, false
	}
	return o.CreatedAt, true
}

// HasCreatedAt returns a boolean if a field has been set.
func (o *Box) HasCreatedAt() bool {
	if o != nil && !IsNil(o.CreatedAt) {
		return true
	}

	return false
}

// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field.
func (o *Box) SetCreatedAt(v string) {
	o.CreatedAt = &v
}

// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *Box) GetUpdatedAt() string {
	if o == nil || IsNil(o.UpdatedAt) {
		var ret string
		return ret
	}
	return *o.UpdatedAt
}

// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Box) GetUpdatedAtOk() (*string, bool) {
	if o == nil || IsNil(o.UpdatedAt) {
		return nil, false
	}
	return o.UpdatedAt, true
}

// HasUpdatedAt returns a boolean if a field has been set.
func (o *Box) HasUpdatedAt() bool {
	if o != nil && !IsNil(o.UpdatedAt) {
		return true
	}

	return false
}

// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field.
func (o *Box) SetUpdatedAt(v string) {
	o.UpdatedAt = &v
}

// GetLastActivityAt returns the LastActivityAt field value if set, zero value otherwise.
func (o *Box) GetLastActivityAt() string {
	if o == nil || IsNil(o.LastActivityAt) {
		var ret string
		return ret
	}
	return *o.LastActivityAt
}

// GetLastActivityAtOk returns a tuple with the LastActivityAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Box) GetLastActivityAtOk() (*string, bool) {
	if o == nil || IsNil(o.LastActivityAt) {
		return nil, false
	}
	return o.LastActivityAt, true
}

// HasLastActivityAt returns a boolean if a field has been set.
func (o *Box) HasLastActivityAt() bool {
	if o != nil && !IsNil(o.LastActivityAt) {
		return true
	}

	return false
}

// SetLastActivityAt gets a reference to the given string and assigns it to the LastActivityAt field.
func (o *Box) SetLastActivityAt(v string) {
	o.LastActivityAt = &v
}

// GetExitCode returns the ExitCode field value if set, zero value otherwise.
func (o *Box) GetExitCode() int32 {
	if o == nil || IsNil(o.ExitCode) {
		var ret int32
		return ret
	}
	return *o.ExitCode
}

// GetExitCodeOk returns a tuple with the ExitCode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Box) GetExitCodeOk() (*int32, bool) {
	if o == nil || IsNil(o.ExitCode) {
		return nil, false
	}
	return o.ExitCode, true
}

// HasExitCode returns a boolean if a field has been set.
func (o *Box) HasExitCode() bool {
	if o != nil && !IsNil(o.ExitCode) {
		return true
	}

	return false
}

// SetExitCode gets a reference to the given int32 and assigns it to the ExitCode field.
func (o *Box) SetExitCode(v int32) {
	o.ExitCode = &v
}

// GetClass returns the Class field value if set, zero value otherwise.
// Deprecated
func (o *Box) GetClass() string {
	if o == nil || IsNil(o.Class) {
		var ret string
		return ret
	}
	return *o.Class
}

// GetClassOk returns a tuple with the Class field value if set, nil otherwise
// and a boolean to check if the value has been set.
// Deprecated
func (o *Box) GetClassOk() (*string, bool) {
	if o == nil || IsNil(o.Class) {
		return nil, false
	}
	return o.Class, true
}

// HasClass returns a boolean if a field has been set.
func (o *Box) HasClass() bool {
	if o != nil && !IsNil(o.Class) {
		return true
	}

	return false
}

// SetClass gets a reference to the given string and assigns it to the Class field.
// Deprecated
func (o *Box) SetClass(v string) {
	o.Class = &v
}

// GetDaemonVersion returns the DaemonVersion field value if set, zero value otherwise.
func (o *Box) GetDaemonVersion() string {
	if o == nil || IsNil(o.DaemonVersion) {
		var ret string
		return ret
	}
	return *o.DaemonVersion
}

// GetDaemonVersionOk returns a tuple with the DaemonVersion field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Box) GetDaemonVersionOk() (*string, bool) {
	if o == nil || IsNil(o.DaemonVersion) {
		return nil, false
	}
	return o.DaemonVersion, true
}

// HasDaemonVersion returns a boolean if a field has been set.
func (o *Box) HasDaemonVersion() bool {
	if o != nil && !IsNil(o.DaemonVersion) {
		return true
	}

	return false
}

// SetDaemonVersion gets a reference to the given string and assigns it to the DaemonVersion field.
func (o *Box) SetDaemonVersion(v string) {
	o.DaemonVersion = &v
}

// GetRunnerId returns the RunnerId field value if set, zero value otherwise.
func (o *Box) GetRunnerId() string {
	if o == nil || IsNil(o.RunnerId) {
		var ret string
		return ret
	}
	return *o.RunnerId
}

// GetRunnerIdOk returns a tuple with the RunnerId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Box) GetRunnerIdOk() (*string, bool) {
	if o == nil || IsNil(o.RunnerId) {
		return nil, false
	}
	return o.RunnerId, true
}

// HasRunnerId returns a boolean if a field has been set.
func (o *Box) HasRunnerId() bool {
	if o != nil && !IsNil(o.RunnerId) {
		return true
	}

	return false
}

// SetRunnerId gets a reference to the given string and assigns it to the RunnerId field.
func (o *Box) SetRunnerId(v string) {
	o.RunnerId = &v
}

// GetProgress returns the Progress field value if set, zero value otherwise.
func (o *Box) GetProgress() BoxProgress {
	if o == nil || IsNil(o.Progress) {
		var ret BoxProgress
		return ret
	}
	return *o.Progress
}

// GetProgressOk returns a tuple with the Progress field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Box) GetProgressOk() (*BoxProgress, bool) {
	if o == nil || IsNil(o.Progress) {
		return nil, false
	}
	return o.Progress, true
}

// HasProgress returns a boolean if a field has been set.
func (o *Box) HasProgress() bool {
	if o != nil && !IsNil(o.Progress) {
		return true
	}

	return false
}

// SetProgress gets a reference to the given BoxProgress and assigns it to the Progress field.
func (o *Box) SetProgress(v BoxProgress) {
	o.Progress = &v
}

func (o Box) MarshalJSON() ([]byte, error) {
	toSerialize,err := o.ToMap()
	if err != nil {
		return []byte{}, err
	}
	return json.Marshal(toSerialize)
}

func (o Box) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["id"] = o.Id
	toSerialize["organizationId"] = o.OrganizationId
	toSerialize["name"] = o.Name
	toSerialize["user"] = o.User
	toSerialize["env"] = o.Env
	toSerialize["labels"] = o.Labels
	if !IsNil(o.Network) {
		toSerialize["network"] = o.Network
	}
	toSerialize["target"] = o.Target
	if !IsNil(o.Image) {
		toSerialize["image"] = o.Image
	}
	toSerialize["cpu"] = o.Cpu
	toSerialize["gpu"] = o.Gpu
	toSerialize["memory"] = o.Memory
	toSerialize["disk"] = o.Disk
	if !IsNil(o.Privileged) {
		toSerialize["privileged"] = o.Privileged
	}
	if !IsNil(o.State) {
		toSerialize["state"] = o.State
	}
	if !IsNil(o.DesiredState) {
		toSerialize["desiredState"] = o.DesiredState
	}
	if !IsNil(o.ErrorReason) {
		toSerialize["errorReason"] = o.ErrorReason
	}
	if !IsNil(o.Recoverable) {
		toSerialize["recoverable"] = o.Recoverable
	}
	if !IsNil(o.AutoStop) {
		toSerialize["autoStop"] = o.AutoStop
	}
	if !IsNil(o.AutoDelete) {
		toSerialize["autoDelete"] = o.AutoDelete
	}
	if !IsNil(o.AutoResume) {
		toSerialize["autoResume"] = o.AutoResume
	}
	if !IsNil(o.Volumes) {
		toSerialize["volumes"] = o.Volumes
	}
	if !IsNil(o.CreatedAt) {
		toSerialize["createdAt"] = o.CreatedAt
	}
	if !IsNil(o.UpdatedAt) {
		toSerialize["updatedAt"] = o.UpdatedAt
	}
	if !IsNil(o.LastActivityAt) {
		toSerialize["lastActivityAt"] = o.LastActivityAt
	}
	if !IsNil(o.ExitCode) {
		toSerialize["exitCode"] = o.ExitCode
	}
	if !IsNil(o.Class) {
		toSerialize["class"] = o.Class
	}
	if !IsNil(o.DaemonVersion) {
		toSerialize["daemonVersion"] = o.DaemonVersion
	}
	if !IsNil(o.RunnerId) {
		toSerialize["runnerId"] = o.RunnerId
	}
	if !IsNil(o.Progress) {
		toSerialize["progress"] = o.Progress
	}

	for key, value := range o.AdditionalProperties {
		toSerialize[key] = value
	}

	return toSerialize, nil
}

func (o *Box) UnmarshalJSON(data []byte) (err error) {
	// This validates that all required properties are included in the JSON object
	// by unmarshalling the object into a generic map with string keys and checking
	// that every required field exists as a key in the generic map.
	requiredProperties := []string{
		"id",
		"organizationId",
		"name",
		"user",
		"env",
		"labels",
		"target",
		"cpu",
		"gpu",
		"memory",
		"disk",
	}

	allProperties := make(map[string]interface{})

	err = json.Unmarshal(data, &allProperties)

	if err != nil {
		return err;
	}

	for _, requiredProperty := range(requiredProperties) {
		if _, exists := allProperties[requiredProperty]; !exists {
			return fmt.Errorf("no value given for required property %v", requiredProperty)
		}
	}

	varBox := _Box{}

	err = json.Unmarshal(data, &varBox)

	if err != nil {
		return err
	}

	*o = Box(varBox)

	additionalProperties := make(map[string]interface{})

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "id")
		delete(additionalProperties, "organizationId")
		delete(additionalProperties, "name")
		delete(additionalProperties, "user")
		delete(additionalProperties, "env")
		delete(additionalProperties, "labels")
		delete(additionalProperties, "network")
		delete(additionalProperties, "target")
		delete(additionalProperties, "image")
		delete(additionalProperties, "cpu")
		delete(additionalProperties, "gpu")
		delete(additionalProperties, "memory")
		delete(additionalProperties, "disk")
		delete(additionalProperties, "privileged")
		delete(additionalProperties, "state")
		delete(additionalProperties, "desiredState")
		delete(additionalProperties, "errorReason")
		delete(additionalProperties, "recoverable")
		delete(additionalProperties, "autoStop")
		delete(additionalProperties, "autoDelete")
		delete(additionalProperties, "autoResume")
		delete(additionalProperties, "volumes")
		delete(additionalProperties, "createdAt")
		delete(additionalProperties, "updatedAt")
		delete(additionalProperties, "lastActivityAt")
		delete(additionalProperties, "exitCode")
		delete(additionalProperties, "class")
		delete(additionalProperties, "daemonVersion")
		delete(additionalProperties, "runnerId")
		delete(additionalProperties, "progress")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableBox struct {
	value *Box
	isSet bool
}

func (v NullableBox) Get() *Box {
	return v.value
}

func (v *NullableBox) Set(val *Box) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableBox(val *Box) *NullableBox {
	return &NullableBox{value: val, isSet: true}
}

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

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