Skip to content

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

13.0 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 AdminRegionOverview type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AdminRegionOverview{}

// AdminRegionOverview struct for AdminRegionOverview
type AdminRegionOverview struct {
	Id string `json:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
	State string `json:"state"`
	RunnerCount float32 `json:"runnerCount"`
	BoxCount float32 `json:"boxCount"`
	QueueDepth float32 `json:"queueDepth"`
	CpuCapacityMillis NullableFloat32 `json:"cpuCapacityMillis,omitempty"`
	// Integer encoded as a decimal string
	MemoryCapacityBytes NullableString `json:"memoryCapacityBytes,omitempty"`
	ObservedAt NullableTime `json:"observedAt,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _AdminRegionOverview AdminRegionOverview

// NewAdminRegionOverview instantiates a new AdminRegionOverview 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 NewAdminRegionOverview(id string, name string, type_ string, state string, runnerCount float32, boxCount float32, queueDepth float32) *AdminRegionOverview {
	this := AdminRegionOverview{}
	this.Id = id
	this.Name = name
	this.Type = type_
	this.State = state
	this.RunnerCount = runnerCount
	this.BoxCount = boxCount
	this.QueueDepth = queueDepth
	return &this
}

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

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

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

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

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

// GetType returns the Type field value
func (o *AdminRegionOverview) GetType() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Type
}

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

// SetType sets field value
func (o *AdminRegionOverview) SetType(v string) {
	o.Type = v
}

// GetState returns the State field value
func (o *AdminRegionOverview) GetState() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.State
}

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

// SetState sets field value
func (o *AdminRegionOverview) SetState(v string) {
	o.State = v
}

// GetRunnerCount returns the RunnerCount field value
func (o *AdminRegionOverview) GetRunnerCount() float32 {
	if o == nil {
		var ret float32
		return ret
	}

	return o.RunnerCount
}

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

// SetRunnerCount sets field value
func (o *AdminRegionOverview) SetRunnerCount(v float32) {
	o.RunnerCount = v
}

// GetBoxCount returns the BoxCount field value
func (o *AdminRegionOverview) GetBoxCount() float32 {
	if o == nil {
		var ret float32
		return ret
	}

	return o.BoxCount
}

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

// SetBoxCount sets field value
func (o *AdminRegionOverview) SetBoxCount(v float32) {
	o.BoxCount = v
}

// GetQueueDepth returns the QueueDepth field value
func (o *AdminRegionOverview) GetQueueDepth() float32 {
	if o == nil {
		var ret float32
		return ret
	}

	return o.QueueDepth
}

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

// SetQueueDepth sets field value
func (o *AdminRegionOverview) SetQueueDepth(v float32) {
	o.QueueDepth = v
}

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

// GetCpuCapacityMillisOk returns a tuple with the CpuCapacityMillis 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 *AdminRegionOverview) GetCpuCapacityMillisOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return o.CpuCapacityMillis.Get(), o.CpuCapacityMillis.IsSet()
}

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

	return false
}

// SetCpuCapacityMillis gets a reference to the given NullableFloat32 and assigns it to the CpuCapacityMillis field.
func (o *AdminRegionOverview) SetCpuCapacityMillis(v float32) {
	o.CpuCapacityMillis.Set(&v)
}
// SetCpuCapacityMillisNil sets the value for CpuCapacityMillis to be an explicit nil
func (o *AdminRegionOverview) SetCpuCapacityMillisNil() {
	o.CpuCapacityMillis.Set(nil)
}

// UnsetCpuCapacityMillis ensures that no value is present for CpuCapacityMillis, not even an explicit nil
func (o *AdminRegionOverview) UnsetCpuCapacityMillis() {
	o.CpuCapacityMillis.Unset()
}

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

// GetMemoryCapacityBytesOk returns a tuple with the MemoryCapacityBytes 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 *AdminRegionOverview) GetMemoryCapacityBytesOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.MemoryCapacityBytes.Get(), o.MemoryCapacityBytes.IsSet()
}

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

	return false
}

// SetMemoryCapacityBytes gets a reference to the given NullableString and assigns it to the MemoryCapacityBytes field.
func (o *AdminRegionOverview) SetMemoryCapacityBytes(v string) {
	o.MemoryCapacityBytes.Set(&v)
}
// SetMemoryCapacityBytesNil sets the value for MemoryCapacityBytes to be an explicit nil
func (o *AdminRegionOverview) SetMemoryCapacityBytesNil() {
	o.MemoryCapacityBytes.Set(nil)
}

// UnsetMemoryCapacityBytes ensures that no value is present for MemoryCapacityBytes, not even an explicit nil
func (o *AdminRegionOverview) UnsetMemoryCapacityBytes() {
	o.MemoryCapacityBytes.Unset()
}

// GetObservedAt returns the ObservedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AdminRegionOverview) 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 *AdminRegionOverview) 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 *AdminRegionOverview) 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 *AdminRegionOverview) SetObservedAt(v time.Time) {
	o.ObservedAt.Set(&v)
}
// SetObservedAtNil sets the value for ObservedAt to be an explicit nil
func (o *AdminRegionOverview) SetObservedAtNil() {
	o.ObservedAt.Set(nil)
}

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

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

func (o AdminRegionOverview) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["id"] = o.Id
	toSerialize["name"] = o.Name
	toSerialize["type"] = o.Type
	toSerialize["state"] = o.State
	toSerialize["runnerCount"] = o.RunnerCount
	toSerialize["boxCount"] = o.BoxCount
	toSerialize["queueDepth"] = o.QueueDepth
	if o.CpuCapacityMillis.IsSet() {
		toSerialize["cpuCapacityMillis"] = o.CpuCapacityMillis.Get()
	}
	if o.MemoryCapacityBytes.IsSet() {
		toSerialize["memoryCapacityBytes"] = o.MemoryCapacityBytes.Get()
	}
	if o.ObservedAt.IsSet() {
		toSerialize["observedAt"] = o.ObservedAt.Get()
	}

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

	return toSerialize, nil
}

func (o *AdminRegionOverview) 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",
		"type",
		"state",
		"runnerCount",
		"boxCount",
		"queueDepth",
	}

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

	varAdminRegionOverview := _AdminRegionOverview{}

	err = json.Unmarshal(data, &varAdminRegionOverview)

	if err != nil {
		return err
	}

	*o = AdminRegionOverview(varAdminRegionOverview)

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

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "id")
		delete(additionalProperties, "name")
		delete(additionalProperties, "type")
		delete(additionalProperties, "state")
		delete(additionalProperties, "runnerCount")
		delete(additionalProperties, "boxCount")
		delete(additionalProperties, "queueDepth")
		delete(additionalProperties, "cpuCapacityMillis")
		delete(additionalProperties, "memoryCapacityBytes")
		delete(additionalProperties, "observedAt")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableAdminRegionOverview struct {
	value *AdminRegionOverview
	isSet bool
}

func (v NullableAdminRegionOverview) Get() *AdminRegionOverview {
	return v.value
}

func (v *NullableAdminRegionOverview) Set(val *AdminRegionOverview) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableAdminRegionOverview(val *AdminRegionOverview) *NullableAdminRegionOverview {
	return &NullableAdminRegionOverview{value: val, isSet: true}
}

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

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