Skip to content

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

17.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"
	"time"
	"fmt"
)

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

// AdminBoxOverview struct for AdminBoxOverview
type AdminBoxOverview struct {
	Id string `json:"id"`
	Name string `json:"name"`
	// Stored Box image reference, when available. Null when no image is stored.
	Image NullableString `json:"image,omitempty"`
	OrganizationId string `json:"organizationId"`
	RunnerId NullableString `json:"runnerId,omitempty"`
	RegionId string `json:"regionId"`
	DesiredState string `json:"desiredState"`
	ObservedState string `json:"observedState"`
	Health string `json:"health"`
	CpuMillis NullableFloat32 `json:"cpuMillis,omitempty"`
	// Integer encoded as a decimal string
	MemoryBytes NullableString `json:"memoryBytes,omitempty"`
	// Integer encoded as a decimal string
	StorageBytes NullableString `json:"storageBytes,omitempty"`
	ActiveJobCount float32 `json:"activeJobCount"`
	ObservedAt NullableTime `json:"observedAt,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _AdminBoxOverview AdminBoxOverview

// NewAdminBoxOverview instantiates a new AdminBoxOverview 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 NewAdminBoxOverview(id string, name string, organizationId string, regionId string, desiredState string, observedState string, health string, activeJobCount float32) *AdminBoxOverview {
	this := AdminBoxOverview{}
	this.Id = id
	this.Name = name
	this.OrganizationId = organizationId
	this.RegionId = regionId
	this.DesiredState = desiredState
	this.ObservedState = observedState
	this.Health = health
	this.ActiveJobCount = activeJobCount
	return &this
}

// NewAdminBoxOverviewWithDefaults instantiates a new AdminBoxOverview 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 NewAdminBoxOverviewWithDefaults() *AdminBoxOverview {
	this := AdminBoxOverview{}
	return &this
}

// GetId returns the Id field value
func (o *AdminBoxOverview) 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 *AdminBoxOverview) GetIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Id, true
}

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

// GetName returns the Name field value
func (o *AdminBoxOverview) 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 *AdminBoxOverview) GetNameOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Name, true
}

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

// GetImage returns the Image field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AdminBoxOverview) GetImage() string {
	if o == nil || IsNil(o.Image.Get()) {
		var ret string
		return ret
	}
	return *o.Image.Get()
}

// GetImageOk returns a tuple with the Image field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *AdminBoxOverview) GetImageOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.Image.Get(), o.Image.IsSet()
}

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

	return false
}

// SetImage gets a reference to the given NullableString and assigns it to the Image field.
func (o *AdminBoxOverview) SetImage(v string) {
	o.Image.Set(&v)
}
// SetImageNil sets the value for Image to be an explicit nil
func (o *AdminBoxOverview) SetImageNil() {
	o.Image.Set(nil)
}

// UnsetImage ensures that no value is present for Image, not even an explicit nil
func (o *AdminBoxOverview) UnsetImage() {
	o.Image.Unset()
}

// GetOrganizationId returns the OrganizationId field value
func (o *AdminBoxOverview) 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 *AdminBoxOverview) GetOrganizationIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.OrganizationId, true
}

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

// GetRunnerId returns the RunnerId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AdminBoxOverview) GetRunnerId() string {
	if o == nil || IsNil(o.RunnerId.Get()) {
		var ret string
		return ret
	}
	return *o.RunnerId.Get()
}

// GetRunnerIdOk returns a tuple with the RunnerId field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *AdminBoxOverview) GetRunnerIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.RunnerId.Get(), o.RunnerId.IsSet()
}

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

	return false
}

// SetRunnerId gets a reference to the given NullableString and assigns it to the RunnerId field.
func (o *AdminBoxOverview) SetRunnerId(v string) {
	o.RunnerId.Set(&v)
}
// SetRunnerIdNil sets the value for RunnerId to be an explicit nil
func (o *AdminBoxOverview) SetRunnerIdNil() {
	o.RunnerId.Set(nil)
}

// UnsetRunnerId ensures that no value is present for RunnerId, not even an explicit nil
func (o *AdminBoxOverview) UnsetRunnerId() {
	o.RunnerId.Unset()
}

// GetRegionId returns the RegionId field value
func (o *AdminBoxOverview) GetRegionId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.RegionId
}

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

// SetRegionId sets field value
func (o *AdminBoxOverview) SetRegionId(v string) {
	o.RegionId = v
}

// GetDesiredState returns the DesiredState field value
func (o *AdminBoxOverview) GetDesiredState() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.DesiredState
}

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

// SetDesiredState sets field value
func (o *AdminBoxOverview) SetDesiredState(v string) {
	o.DesiredState = v
}

// GetObservedState returns the ObservedState field value
func (o *AdminBoxOverview) GetObservedState() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.ObservedState
}

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

// SetObservedState sets field value
func (o *AdminBoxOverview) SetObservedState(v string) {
	o.ObservedState = v
}

// GetHealth returns the Health field value
func (o *AdminBoxOverview) GetHealth() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Health
}

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

// SetHealth sets field value
func (o *AdminBoxOverview) SetHealth(v string) {
	o.Health = v
}

// GetCpuMillis returns the CpuMillis field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AdminBoxOverview) GetCpuMillis() float32 {
	if o == nil || IsNil(o.CpuMillis.Get()) {
		var ret float32
		return ret
	}
	return *o.CpuMillis.Get()
}

// GetCpuMillisOk returns a tuple with the CpuMillis field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *AdminBoxOverview) GetCpuMillisOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return o.CpuMillis.Get(), o.CpuMillis.IsSet()
}

// HasCpuMillis returns a boolean if a field has been set.
func (o *AdminBoxOverview) HasCpuMillis() bool {
	if o != nil && o.CpuMillis.IsSet() {
		return true
	}

	return false
}

// SetCpuMillis gets a reference to the given NullableFloat32 and assigns it to the CpuMillis field.
func (o *AdminBoxOverview) SetCpuMillis(v float32) {
	o.CpuMillis.Set(&v)
}
// SetCpuMillisNil sets the value for CpuMillis to be an explicit nil
func (o *AdminBoxOverview) SetCpuMillisNil() {
	o.CpuMillis.Set(nil)
}

// UnsetCpuMillis ensures that no value is present for CpuMillis, not even an explicit nil
func (o *AdminBoxOverview) UnsetCpuMillis() {
	o.CpuMillis.Unset()
}

// GetMemoryBytes returns the MemoryBytes field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AdminBoxOverview) GetMemoryBytes() string {
	if o == nil || IsNil(o.MemoryBytes.Get()) {
		var ret string
		return ret
	}
	return *o.MemoryBytes.Get()
}

// GetMemoryBytesOk returns a tuple with the MemoryBytes field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *AdminBoxOverview) GetMemoryBytesOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.MemoryBytes.Get(), o.MemoryBytes.IsSet()
}

// HasMemoryBytes returns a boolean if a field has been set.
func (o *AdminBoxOverview) HasMemoryBytes() bool {
	if o != nil && o.MemoryBytes.IsSet() {
		return true
	}

	return false
}

// SetMemoryBytes gets a reference to the given NullableString and assigns it to the MemoryBytes field.
func (o *AdminBoxOverview) SetMemoryBytes(v string) {
	o.MemoryBytes.Set(&v)
}
// SetMemoryBytesNil sets the value for MemoryBytes to be an explicit nil
func (o *AdminBoxOverview) SetMemoryBytesNil() {
	o.MemoryBytes.Set(nil)
}

// UnsetMemoryBytes ensures that no value is present for MemoryBytes, not even an explicit nil
func (o *AdminBoxOverview) UnsetMemoryBytes() {
	o.MemoryBytes.Unset()
}

// GetStorageBytes returns the StorageBytes field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AdminBoxOverview) GetStorageBytes() string {
	if o == nil || IsNil(o.StorageBytes.Get()) {
		var ret string
		return ret
	}
	return *o.StorageBytes.Get()
}

// GetStorageBytesOk returns a tuple with the StorageBytes field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *AdminBoxOverview) GetStorageBytesOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.StorageBytes.Get(), o.StorageBytes.IsSet()
}

// HasStorageBytes returns a boolean if a field has been set.
func (o *AdminBoxOverview) HasStorageBytes() bool {
	if o != nil && o.StorageBytes.IsSet() {
		return true
	}

	return false
}

// SetStorageBytes gets a reference to the given NullableString and assigns it to the StorageBytes field.
func (o *AdminBoxOverview) SetStorageBytes(v string) {
	o.StorageBytes.Set(&v)
}
// SetStorageBytesNil sets the value for StorageBytes to be an explicit nil
func (o *AdminBoxOverview) SetStorageBytesNil() {
	o.StorageBytes.Set(nil)
}

// UnsetStorageBytes ensures that no value is present for StorageBytes, not even an explicit nil
func (o *AdminBoxOverview) UnsetStorageBytes() {
	o.StorageBytes.Unset()
}

// GetActiveJobCount returns the ActiveJobCount field value
func (o *AdminBoxOverview) GetActiveJobCount() float32 {
	if o == nil {
		var ret float32
		return ret
	}

	return o.ActiveJobCount
}

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

// SetActiveJobCount sets field value
func (o *AdminBoxOverview) SetActiveJobCount(v float32) {
	o.ActiveJobCount = v
}

// GetObservedAt returns the ObservedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AdminBoxOverview) GetObservedAt() time.Time {
	if o == nil || IsNil(o.ObservedAt.Get()) {
		var ret time.Time
		return ret
	}
	return *o.ObservedAt.Get()
}

// GetObservedAtOk returns a tuple with the ObservedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *AdminBoxOverview) GetObservedAtOk() (*time.Time, bool) {
	if o == nil {
		return nil, false
	}
	return o.ObservedAt.Get(), o.ObservedAt.IsSet()
}

// HasObservedAt returns a boolean if a field has been set.
func (o *AdminBoxOverview) HasObservedAt() bool {
	if o != nil && o.ObservedAt.IsSet() {
		return true
	}

	return false
}

// SetObservedAt gets a reference to the given NullableTime and assigns it to the ObservedAt field.
func (o *AdminBoxOverview) SetObservedAt(v time.Time) {
	o.ObservedAt.Set(&v)
}
// SetObservedAtNil sets the value for ObservedAt to be an explicit nil
func (o *AdminBoxOverview) SetObservedAtNil() {
	o.ObservedAt.Set(nil)
}

// UnsetObservedAt ensures that no value is present for ObservedAt, not even an explicit nil
func (o *AdminBoxOverview) UnsetObservedAt() {
	o.ObservedAt.Unset()
}

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

func (o AdminBoxOverview) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["id"] = o.Id
	toSerialize["name"] = o.Name
	if o.Image.IsSet() {
		toSerialize["image"] = o.Image.Get()
	}
	toSerialize["organizationId"] = o.OrganizationId
	if o.RunnerId.IsSet() {
		toSerialize["runnerId"] = o.RunnerId.Get()
	}
	toSerialize["regionId"] = o.RegionId
	toSerialize["desiredState"] = o.DesiredState
	toSerialize["observedState"] = o.ObservedState
	toSerialize["health"] = o.Health
	if o.CpuMillis.IsSet() {
		toSerialize["cpuMillis"] = o.CpuMillis.Get()
	}
	if o.MemoryBytes.IsSet() {
		toSerialize["memoryBytes"] = o.MemoryBytes.Get()
	}
	if o.StorageBytes.IsSet() {
		toSerialize["storageBytes"] = o.StorageBytes.Get()
	}
	toSerialize["activeJobCount"] = o.ActiveJobCount
	if o.ObservedAt.IsSet() {
		toSerialize["observedAt"] = o.ObservedAt.Get()
	}

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

	return toSerialize, nil
}

func (o *AdminBoxOverview) 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",
		"name",
		"organizationId",
		"regionId",
		"desiredState",
		"observedState",
		"health",
		"activeJobCount",
	}

	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)
		}
	}

	varAdminBoxOverview := _AdminBoxOverview{}

	err = json.Unmarshal(data, &varAdminBoxOverview)

	if err != nil {
		return err
	}

	*o = AdminBoxOverview(varAdminBoxOverview)

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

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "id")
		delete(additionalProperties, "name")
		delete(additionalProperties, "image")
		delete(additionalProperties, "organizationId")
		delete(additionalProperties, "runnerId")
		delete(additionalProperties, "regionId")
		delete(additionalProperties, "desiredState")
		delete(additionalProperties, "observedState")
		delete(additionalProperties, "health")
		delete(additionalProperties, "cpuMillis")
		delete(additionalProperties, "memoryBytes")
		delete(additionalProperties, "storageBytes")
		delete(additionalProperties, "activeJobCount")
		delete(additionalProperties, "observedAt")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableAdminBoxOverview struct {
	value *AdminBoxOverview
	isSet bool
}

func (v NullableAdminBoxOverview) Get() *AdminBoxOverview {
	return v.value
}

func (v *NullableAdminBoxOverview) Set(val *AdminBoxOverview) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableAdminBoxOverview(val *AdminBoxOverview) *NullableAdminBoxOverview {
	return &NullableAdminBoxOverview{value: val, isSet: true}
}

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

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