Skip to content

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

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

// ImageDetail struct for ImageDetail
type ImageDetail struct {
	// What to pass as a box image to boot from this: the curated short name, or the upstream repository path
	Name string `json:"name"`
	// Catalog row ID. Null for curated images, which are operator configuration rather than rows
	Id NullableString `json:"id"`
	// Whether this is one of the operator-provided images every organization shares. Curated images cannot be deleted and do not count against the organization limit
	Curated bool `json:"curated"`
	// The exact reference a curated image resolves to. Null for catalog images, which resolve through their versions
	CuratedRef NullableString `json:"curatedRef"`
	// Aliases recorded for this image. Empty for curated images, whose reference the operator pins
	Aliases []string `json:"aliases"`
	// How many pulled manifest digests this image holds
	VersionCount float32 `json:"versionCount"`
	// Sum of the pulled versions’ declared sizes, in bytes. Layers shared between versions are counted once per version. Null for curated images, whose bytes this system never measured
	SizeBytes NullableFloat32 `json:"sizeBytes"`
	// When a box last booted from this image
	LastUsedAt NullableString `json:"lastUsedAt"`
	// When this image first entered the catalog. Null for curated images
	CreatedAt NullableString `json:"createdAt"`
	// Every pulled version, newest first
	Versions []ImageVersion `json:"versions"`
	// Alias registration history, newest first and at most 100 events. Empty for curated images
	History []ImageAliasEvent `json:"history"`
	AdditionalProperties map[string]interface{}
}

type _ImageDetail ImageDetail

// NewImageDetail instantiates a new ImageDetail 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 NewImageDetail(name string, id NullableString, curated bool, curatedRef NullableString, aliases []string, versionCount float32, sizeBytes NullableFloat32, lastUsedAt NullableString, createdAt NullableString, versions []ImageVersion, history []ImageAliasEvent) *ImageDetail {
	this := ImageDetail{}
	this.Name = name
	this.Id = id
	this.Curated = curated
	this.CuratedRef = curatedRef
	this.Aliases = aliases
	this.VersionCount = versionCount
	this.SizeBytes = sizeBytes
	this.LastUsedAt = lastUsedAt
	this.CreatedAt = createdAt
	this.Versions = versions
	this.History = history
	return &this
}

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

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

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

// GetId returns the Id field value
// If the value is explicit nil, the zero value for string will be returned
func (o *ImageDetail) GetId() string {
	if o == nil || o.Id.Get() == nil {
		var ret string
		return ret
	}

	return *o.Id.Get()
}

// GetIdOk returns a tuple with the Id field value
// 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 *ImageDetail) GetIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.Id.Get(), o.Id.IsSet()
}

// SetId sets field value
func (o *ImageDetail) SetId(v string) {
	o.Id.Set(&v)
}

// GetCurated returns the Curated field value
func (o *ImageDetail) GetCurated() bool {
	if o == nil {
		var ret bool
		return ret
	}

	return o.Curated
}

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

// SetCurated sets field value
func (o *ImageDetail) SetCurated(v bool) {
	o.Curated = v
}

// GetCuratedRef returns the CuratedRef field value
// If the value is explicit nil, the zero value for string will be returned
func (o *ImageDetail) GetCuratedRef() string {
	if o == nil || o.CuratedRef.Get() == nil {
		var ret string
		return ret
	}

	return *o.CuratedRef.Get()
}

// GetCuratedRefOk returns a tuple with the CuratedRef field value
// 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 *ImageDetail) GetCuratedRefOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.CuratedRef.Get(), o.CuratedRef.IsSet()
}

// SetCuratedRef sets field value
func (o *ImageDetail) SetCuratedRef(v string) {
	o.CuratedRef.Set(&v)
}

// GetAliases returns the Aliases field value
func (o *ImageDetail) GetAliases() []string {
	if o == nil {
		var ret []string
		return ret
	}

	return o.Aliases
}

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

// SetAliases sets field value
func (o *ImageDetail) SetAliases(v []string) {
	o.Aliases = v
}

// GetVersionCount returns the VersionCount field value
func (o *ImageDetail) GetVersionCount() float32 {
	if o == nil {
		var ret float32
		return ret
	}

	return o.VersionCount
}

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

// SetVersionCount sets field value
func (o *ImageDetail) SetVersionCount(v float32) {
	o.VersionCount = v
}

// GetSizeBytes returns the SizeBytes field value
// If the value is explicit nil, the zero value for float32 will be returned
func (o *ImageDetail) GetSizeBytes() float32 {
	if o == nil || o.SizeBytes.Get() == nil {
		var ret float32
		return ret
	}

	return *o.SizeBytes.Get()
}

// GetSizeBytesOk returns a tuple with the SizeBytes field value
// 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 *ImageDetail) GetSizeBytesOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return o.SizeBytes.Get(), o.SizeBytes.IsSet()
}

// SetSizeBytes sets field value
func (o *ImageDetail) SetSizeBytes(v float32) {
	o.SizeBytes.Set(&v)
}

// GetLastUsedAt returns the LastUsedAt field value
// If the value is explicit nil, the zero value for string will be returned
func (o *ImageDetail) GetLastUsedAt() string {
	if o == nil || o.LastUsedAt.Get() == nil {
		var ret string
		return ret
	}

	return *o.LastUsedAt.Get()
}

// GetLastUsedAtOk returns a tuple with the LastUsedAt field value
// 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 *ImageDetail) GetLastUsedAtOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.LastUsedAt.Get(), o.LastUsedAt.IsSet()
}

// SetLastUsedAt sets field value
func (o *ImageDetail) SetLastUsedAt(v string) {
	o.LastUsedAt.Set(&v)
}

// GetCreatedAt returns the CreatedAt field value
// If the value is explicit nil, the zero value for string will be returned
func (o *ImageDetail) GetCreatedAt() string {
	if o == nil || o.CreatedAt.Get() == nil {
		var ret string
		return ret
	}

	return *o.CreatedAt.Get()
}

// GetCreatedAtOk returns a tuple with the CreatedAt field value
// 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 *ImageDetail) GetCreatedAtOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.CreatedAt.Get(), o.CreatedAt.IsSet()
}

// SetCreatedAt sets field value
func (o *ImageDetail) SetCreatedAt(v string) {
	o.CreatedAt.Set(&v)
}

// GetVersions returns the Versions field value
func (o *ImageDetail) GetVersions() []ImageVersion {
	if o == nil {
		var ret []ImageVersion
		return ret
	}

	return o.Versions
}

// GetVersionsOk returns a tuple with the Versions field value
// and a boolean to check if the value has been set.
func (o *ImageDetail) GetVersionsOk() ([]ImageVersion, bool) {
	if o == nil {
		return nil, false
	}
	return o.Versions, true
}

// SetVersions sets field value
func (o *ImageDetail) SetVersions(v []ImageVersion) {
	o.Versions = v
}

// GetHistory returns the History field value
func (o *ImageDetail) GetHistory() []ImageAliasEvent {
	if o == nil {
		var ret []ImageAliasEvent
		return ret
	}

	return o.History
}

// GetHistoryOk returns a tuple with the History field value
// and a boolean to check if the value has been set.
func (o *ImageDetail) GetHistoryOk() ([]ImageAliasEvent, bool) {
	if o == nil {
		return nil, false
	}
	return o.History, true
}

// SetHistory sets field value
func (o *ImageDetail) SetHistory(v []ImageAliasEvent) {
	o.History = v
}

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

func (o ImageDetail) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["name"] = o.Name
	toSerialize["id"] = o.Id.Get()
	toSerialize["curated"] = o.Curated
	toSerialize["curatedRef"] = o.CuratedRef.Get()
	toSerialize["aliases"] = o.Aliases
	toSerialize["versionCount"] = o.VersionCount
	toSerialize["sizeBytes"] = o.SizeBytes.Get()
	toSerialize["lastUsedAt"] = o.LastUsedAt.Get()
	toSerialize["createdAt"] = o.CreatedAt.Get()
	toSerialize["versions"] = o.Versions
	toSerialize["history"] = o.History

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

	return toSerialize, nil
}

func (o *ImageDetail) 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{
		"name",
		"id",
		"curated",
		"curatedRef",
		"aliases",
		"versionCount",
		"sizeBytes",
		"lastUsedAt",
		"createdAt",
		"versions",
		"history",
	}

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

	varImageDetail := _ImageDetail{}

	err = json.Unmarshal(data, &varImageDetail)

	if err != nil {
		return err
	}

	*o = ImageDetail(varImageDetail)

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

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "name")
		delete(additionalProperties, "id")
		delete(additionalProperties, "curated")
		delete(additionalProperties, "curatedRef")
		delete(additionalProperties, "aliases")
		delete(additionalProperties, "versionCount")
		delete(additionalProperties, "sizeBytes")
		delete(additionalProperties, "lastUsedAt")
		delete(additionalProperties, "createdAt")
		delete(additionalProperties, "versions")
		delete(additionalProperties, "history")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableImageDetail struct {
	value *ImageDetail
	isSet bool
}

func (v NullableImageDetail) Get() *ImageDetail {
	return v.value
}

func (v *NullableImageDetail) Set(val *ImageDetail) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableImageDetail(val *ImageDetail) *NullableImageDetail {
	return &NullableImageDetail{value: val, isSet: true}
}

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

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