Skip to content

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

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

// BoxMemoryUsageDto struct for BoxMemoryUsageDto
type BoxMemoryUsageDto struct {
	// Business Box ID.
	BoxId string `json:"boxId"`
	// Exact image reference from the same Box snapshot; empty is preserved.
	Image string `json:"image"`
	// Current bytes as a decimal string, between 0 and 9223372036854775807.
	MemoryBytes string `json:"memoryBytes"`
	AdditionalProperties map[string]interface{}
}

type _BoxMemoryUsageDto BoxMemoryUsageDto

// NewBoxMemoryUsageDto instantiates a new BoxMemoryUsageDto 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 NewBoxMemoryUsageDto(boxId string, image string, memoryBytes string) *BoxMemoryUsageDto {
	this := BoxMemoryUsageDto{}
	this.BoxId = boxId
	this.Image = image
	this.MemoryBytes = memoryBytes
	return &this
}

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

// GetBoxId returns the BoxId field value
func (o *BoxMemoryUsageDto) GetBoxId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.BoxId
}

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

// SetBoxId sets field value
func (o *BoxMemoryUsageDto) SetBoxId(v string) {
	o.BoxId = v
}

// GetImage returns the Image field value
func (o *BoxMemoryUsageDto) GetImage() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Image
}

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

// SetImage sets field value
func (o *BoxMemoryUsageDto) SetImage(v string) {
	o.Image = v
}

// GetMemoryBytes returns the MemoryBytes field value
func (o *BoxMemoryUsageDto) GetMemoryBytes() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.MemoryBytes
}

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

// SetMemoryBytes sets field value
func (o *BoxMemoryUsageDto) SetMemoryBytes(v string) {
	o.MemoryBytes = v
}

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

func (o BoxMemoryUsageDto) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["boxId"] = o.BoxId
	toSerialize["image"] = o.Image
	toSerialize["memoryBytes"] = o.MemoryBytes

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

	return toSerialize, nil
}

func (o *BoxMemoryUsageDto) 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{
		"boxId",
		"image",
		"memoryBytes",
	}

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

	varBoxMemoryUsageDto := _BoxMemoryUsageDto{}

	err = json.Unmarshal(data, &varBoxMemoryUsageDto)

	if err != nil {
		return err
	}

	*o = BoxMemoryUsageDto(varBoxMemoryUsageDto)

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

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "boxId")
		delete(additionalProperties, "image")
		delete(additionalProperties, "memoryBytes")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableBoxMemoryUsageDto struct {
	value *BoxMemoryUsageDto
	isSet bool
}

func (v NullableBoxMemoryUsageDto) Get() *BoxMemoryUsageDto {
	return v.value
}

func (v *NullableBoxMemoryUsageDto) Set(val *BoxMemoryUsageDto) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableBoxMemoryUsageDto(val *BoxMemoryUsageDto) *NullableBoxMemoryUsageDto {
	return &NullableBoxMemoryUsageDto{value: val, isSet: true}
}

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

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