The micro-VM for AI agents — light enough to embed on your laptop, elastic enough to power an agentic cloud.
/*
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 AdminBoxDetail type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AdminBoxDetail{}
// AdminBoxDetail struct for AdminBoxDetail
type AdminBoxDetail 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"`
Jobs AdminBoxJobReferencePage `json:"jobs"`
AdditionalProperties map[string]interface{}
}
type _AdminBoxDetail AdminBoxDetail
// NewAdminBoxDetail instantiates a new AdminBoxDetail 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 NewAdminBoxDetail(id string, name string, organizationId string, regionId string, desiredState string, observedState string, health string, activeJobCount float32, jobs AdminBoxJobReferencePage) *AdminBoxDetail {
this := AdminBoxDetail{}
this.Id = id
this.Name = name
this.OrganizationId = organizationId
this.RegionId = regionId
this.DesiredState = desiredState
this.ObservedState = observedState
this.Health = health
this.ActiveJobCount = activeJobCount
this.Jobs = jobs
return &this
}
// NewAdminBoxDetailWithDefaults instantiates a new AdminBoxDetail 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 NewAdminBoxDetailWithDefaults() *AdminBoxDetail {
this := AdminBoxDetail{}
return &this
}
// GetId returns the Id field value
func (o *AdminBoxDetail) 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 *AdminBoxDetail) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *AdminBoxDetail) SetId(v string) {
o.Id = v
}
// GetName returns the Name field value
func (o *AdminBoxDetail) 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 *AdminBoxDetail) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *AdminBoxDetail) 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 *AdminBoxDetail) 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 *AdminBoxDetail) 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 *AdminBoxDetail) 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 *AdminBoxDetail) SetImage(v string) {
o.Image.Set(&v)
}
// SetImageNil sets the value for Image to be an explicit nil
func (o *AdminBoxDetail) SetImageNil() {
o.Image.Set(nil)
}
// UnsetImage ensures that no value is present for Image, not even an explicit nil
func (o *AdminBoxDetail) UnsetImage() {
o.Image.Unset()
}
// GetOrganizationId returns the OrganizationId field value
func (o *AdminBoxDetail) 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 *AdminBoxDetail) GetOrganizationIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.OrganizationId, true
}
// SetOrganizationId sets field value
func (o *AdminBoxDetail) 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 *AdminBoxDetail) 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 *AdminBoxDetail) 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 *AdminBoxDetail) 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 *AdminBoxDetail) SetRunnerId(v string) {
o.RunnerId.Set(&v)
}
// SetRunnerIdNil sets the value for RunnerId to be an explicit nil
func (o *AdminBoxDetail) SetRunnerIdNil() {
o.RunnerId.Set(nil)
}
// UnsetRunnerId ensures that no value is present for RunnerId, not even an explicit nil
func (o *AdminBoxDetail) UnsetRunnerId() {
o.RunnerId.Unset()
}
// GetRegionId returns the RegionId field value
func (o *AdminBoxDetail) 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 *AdminBoxDetail) GetRegionIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.RegionId, true
}
// SetRegionId sets field value
func (o *AdminBoxDetail) SetRegionId(v string) {
o.RegionId = v
}
// GetDesiredState returns the DesiredState field value
func (o *AdminBoxDetail) 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 *AdminBoxDetail) GetDesiredStateOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.DesiredState, true
}
// SetDesiredState sets field value
func (o *AdminBoxDetail) SetDesiredState(v string) {
o.DesiredState = v
}
// GetObservedState returns the ObservedState field value
func (o *AdminBoxDetail) 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 *AdminBoxDetail) GetObservedStateOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ObservedState, true
}
// SetObservedState sets field value
func (o *AdminBoxDetail) SetObservedState(v string) {
o.ObservedState = v
}
// GetHealth returns the Health field value
func (o *AdminBoxDetail) 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 *AdminBoxDetail) GetHealthOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Health, true
}
// SetHealth sets field value
func (o *AdminBoxDetail) 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 *AdminBoxDetail) 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 *AdminBoxDetail) 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 *AdminBoxDetail) 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 *AdminBoxDetail) SetCpuMillis(v float32) {
o.CpuMillis.Set(&v)
}
// SetCpuMillisNil sets the value for CpuMillis to be an explicit nil
func (o *AdminBoxDetail) SetCpuMillisNil() {
o.CpuMillis.Set(nil)
}
// UnsetCpuMillis ensures that no value is present for CpuMillis, not even an explicit nil
func (o *AdminBoxDetail) 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 *AdminBoxDetail) 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 *AdminBoxDetail) 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 *AdminBoxDetail) 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 *AdminBoxDetail) SetMemoryBytes(v string) {
o.MemoryBytes.Set(&v)
}
// SetMemoryBytesNil sets the value for MemoryBytes to be an explicit nil
func (o *AdminBoxDetail) SetMemoryBytesNil() {
o.MemoryBytes.Set(nil)
}
// UnsetMemoryBytes ensures that no value is present for MemoryBytes, not even an explicit nil
func (o *AdminBoxDetail) 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 *AdminBoxDetail) 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 *AdminBoxDetail) 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 *AdminBoxDetail) 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 *AdminBoxDetail) SetStorageBytes(v string) {
o.StorageBytes.Set(&v)
}
// SetStorageBytesNil sets the value for StorageBytes to be an explicit nil
func (o *AdminBoxDetail) SetStorageBytesNil() {
o.StorageBytes.Set(nil)
}
// UnsetStorageBytes ensures that no value is present for StorageBytes, not even an explicit nil
func (o *AdminBoxDetail) UnsetStorageBytes() {
o.StorageBytes.Unset()
}
// GetActiveJobCount returns the ActiveJobCount field value
func (o *AdminBoxDetail) 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 *AdminBoxDetail) GetActiveJobCountOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.ActiveJobCount, true
}
// SetActiveJobCount sets field value
func (o *AdminBoxDetail) 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 *AdminBoxDetail) 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 *AdminBoxDetail) 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 *AdminBoxDetail) 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 *AdminBoxDetail) SetObservedAt(v time.Time) {
o.ObservedAt.Set(&v)
}
// SetObservedAtNil sets the value for ObservedAt to be an explicit nil
func (o *AdminBoxDetail) SetObservedAtNil() {
o.ObservedAt.Set(nil)
}
// UnsetObservedAt ensures that no value is present for ObservedAt, not even an explicit nil
func (o *AdminBoxDetail) UnsetObservedAt() {
o.ObservedAt.Unset()
}
// GetJobs returns the Jobs field value
func (o *AdminBoxDetail) GetJobs() AdminBoxJobReferencePage {
if o == nil {
var ret AdminBoxJobReferencePage
return ret
}
return o.Jobs
}
// GetJobsOk returns a tuple with the Jobs field value
// and a boolean to check if the value has been set.
func (o *AdminBoxDetail) GetJobsOk() (*AdminBoxJobReferencePage, bool) {
if o == nil {
return nil, false
}
return &o.Jobs, true
}
// SetJobs sets field value
func (o *AdminBoxDetail) SetJobs(v AdminBoxJobReferencePage) {
o.Jobs = v
}
func (o AdminBoxDetail) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AdminBoxDetail) 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()
}
toSerialize["jobs"] = o.Jobs
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AdminBoxDetail) 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",
"jobs",
}
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)
}
}
varAdminBoxDetail := _AdminBoxDetail{}
err = json.Unmarshal(data, &varAdminBoxDetail)
if err != nil {
return err
}
*o = AdminBoxDetail(varAdminBoxDetail)
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")
delete(additionalProperties, "jobs")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAdminBoxDetail struct {
value *AdminBoxDetail
isSet bool
}
func (v NullableAdminBoxDetail) Get() *AdminBoxDetail {
return v.value
}
func (v *NullableAdminBoxDetail) Set(val *AdminBoxDetail) {
v.value = val
v.isSet = true
}
func (v NullableAdminBoxDetail) IsSet() bool {
return v.isSet
}
func (v *NullableAdminBoxDetail) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAdminBoxDetail(val *AdminBoxDetail) *NullableAdminBoxDetail {
return &NullableAdminBoxDetail{value: val, isSet: true}
}
func (v NullableAdminBoxDetail) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAdminBoxDetail) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}