Files
sdk/model_sandbox_sandbox.go

725 lines
22 KiB
Go

/*
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hanzoai
import (
"encoding/json"
)
// checks if the SandboxSandbox type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SandboxSandbox{}
// SandboxSandbox struct for SandboxSandbox
type SandboxSandbox struct {
// Actor is the subject who LEASED this sandbox — the validated caller of the act that took the lease, never a value a request supplied. A sandbox is its lessee's: it holds their session, and a coding run's holds a write key to a repository and the codebase's secrets. So the org gates which store a row is in, and this gates who in the org may act on it (holder.holds): the lessee, or an admin of the org, or a SuperAdmin. Empty is a lease taken by the org's own background work, which no person holds.
Actor *string `json:"actor,omitempty"`
// Class is what the sandbox is FOR, and it decides the image, the working directory and the isolation: \"exec\" for a code-interpreter call (workdir /mnt/data, no project, bounded per org), \"dev\" for a workspace bound to a project (workdir /work, single-attach), \"desktop\" for one with a screen.
Class *string `json:"class,omitempty"`
// Cluster is the attached cluster this sandbox runs on — the fleet-local name the lease named — or empty for the home cluster. Immutable for the life of the lease, like the pod it locates: every later call into the sandbox reads it to reach the right apiserver.
Cluster *string `json:"cluster,omitempty"`
// ConnectedAt is when somebody was last known to have this sandbox's project OPEN, Unix seconds. It is a fact with an EXPIRY rather than a flag: a watcher restamps it every beat of its stream, and it goes stale on its own when the stream dies, so nothing has to be turned off by a process that may not be there any more. The reaper reads it to choose WHICH idle allowance applies — see lifecycle.go. Zero means nobody has said so, which puts the sandbox on the short clock.
ConnectedAt *int64 `json:"connectedAt,omitempty"`
// CreatedAt is when the lease was taken, Unix seconds — by the lease that made the sandbox, and again by each resume, which gives a parked sandbox a new pod on a new lease. The ceiling on a sandbox's life runs from it.
CreatedAt *int64 `json:"createdAt,omitempty"`
// Error is why the sandbox could not come up, in plain words. Present only with status \"error\", and it is the field to read rather than inferring a cause from the absence of a pod.
Error *string `json:"error,omitempty"`
// ExpiresAt is when the lease ends, Unix seconds. Past it the reaper may take the sandbox at any time; it is a deadline, not a guarantee of survival until then, since an idle sandbox goes sooner.
ExpiresAt *int64 `json:"expiresAt,omitempty"`
// ID is the sandbox's server-minted handle and what every operation addresses it by. The caller does not choose it.
Id *string `json:"id,omitempty"`
// Image is the container image this sandbox is actually running — the one the class chose, or an override the policy admitted. It is what ran, not what was asked for.
Image *string `json:"image,omitempty"`
// Kind is the resource family this row belongs to. Always \"sandbox\" here; it exists because the store this shares is keyed across kinds.
Kind *string `json:"kind,omitempty"`
// LastUsedAt is when the sandbox last did work, Unix seconds. The reaper reads it: a sandbox idle past the idle window is reclaimed even inside its TTL, because an idle lease is capacity nobody is using.
LastUsedAt *int64 `json:"lastUsedAt,omitempty"`
// Org is the org that holds the lease — the validated caller's, never a value a request supplied. It is also the store's key, so a sandbox is not merely filtered out of another org's answers; it is unreachable from them.
Org *string `json:"org,omitempty"`
// Project is the project this sandbox is bound to. A dev or desktop sandbox has one and is SINGLE-ATTACH under it, so asking twice resumes rather than leasing a second; an exec sandbox has none.
Project *string `json:"project,omitempty"`
// Runtime is the isolation boundary this sandbox GOT, which is not always the one it asked for: a caller states a preference and runtimeFor answers with what the sandbox can actually have. Reported so a person comparing two runtimes is comparing the runtimes they got rather than the ones they typed — the difference between those two is the whole reason to record it. Empty means the node's default runtime, which is a real answer and not a missing one. This is not a copy that can go stale. runtimeClassName is IMMUTABLE on a pod, a sandbox's pod is created once and never recreated (restartPolicy Never, no pool), and its name is never reused — so for as long as the pod this row names exists, it is running this runtime. The alternative, asking the apiserver on every read, buys nothing and costs a round trip per row.
Runtime *string `json:"runtime,omitempty"`
// Status is where the sandbox is in its life: \"pending\" while the pod is coming up, \"running\" once it can take work, \"error\" when it cannot, and \"parked\" when its pod is stopped and its disk kept, until a resume. Only a running sandbox takes an exec or mints an interactive ticket.
Status *string `json:"status,omitempty"`
// Volume is the persistent volume attached to the sandbox, when it has one. A project sandbox keeps its work across leases through the project's disk; a sandbox with no project has one only if its lease asked for a disk of its own, which keeps its files across a park and is deleted with the lease. Without either, everything is lost with the pod.
Volume *string `json:"volume,omitempty"`
AdditionalProperties map[string]interface{}
}
type _SandboxSandbox SandboxSandbox
// NewSandboxSandbox instantiates a new SandboxSandbox 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 NewSandboxSandbox() *SandboxSandbox {
this := SandboxSandbox{}
return &this
}
// NewSandboxSandboxWithDefaults instantiates a new SandboxSandbox 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 NewSandboxSandboxWithDefaults() *SandboxSandbox {
this := SandboxSandbox{}
return &this
}
// GetActor returns the Actor field value if set, zero value otherwise.
func (o *SandboxSandbox) GetActor() string {
if o == nil || IsNil(o.Actor) {
var ret string
return ret
}
return *o.Actor
}
// GetActorOk returns a tuple with the Actor field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxSandbox) GetActorOk() (*string, bool) {
if o == nil || IsNil(o.Actor) {
return nil, false
}
return o.Actor, true
}
// HasActor returns a boolean if a field has been set.
func (o *SandboxSandbox) HasActor() bool {
if o != nil && !IsNil(o.Actor) {
return true
}
return false
}
// SetActor gets a reference to the given string and assigns it to the Actor field.
func (o *SandboxSandbox) SetActor(v string) {
o.Actor = &v
}
// GetClass returns the Class field value if set, zero value otherwise.
func (o *SandboxSandbox) GetClass() string {
if o == nil || IsNil(o.Class) {
var ret string
return ret
}
return *o.Class
}
// GetClassOk returns a tuple with the Class field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxSandbox) GetClassOk() (*string, bool) {
if o == nil || IsNil(o.Class) {
return nil, false
}
return o.Class, true
}
// HasClass returns a boolean if a field has been set.
func (o *SandboxSandbox) HasClass() bool {
if o != nil && !IsNil(o.Class) {
return true
}
return false
}
// SetClass gets a reference to the given string and assigns it to the Class field.
func (o *SandboxSandbox) SetClass(v string) {
o.Class = &v
}
// GetCluster returns the Cluster field value if set, zero value otherwise.
func (o *SandboxSandbox) GetCluster() string {
if o == nil || IsNil(o.Cluster) {
var ret string
return ret
}
return *o.Cluster
}
// GetClusterOk returns a tuple with the Cluster field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxSandbox) GetClusterOk() (*string, bool) {
if o == nil || IsNil(o.Cluster) {
return nil, false
}
return o.Cluster, true
}
// HasCluster returns a boolean if a field has been set.
func (o *SandboxSandbox) HasCluster() bool {
if o != nil && !IsNil(o.Cluster) {
return true
}
return false
}
// SetCluster gets a reference to the given string and assigns it to the Cluster field.
func (o *SandboxSandbox) SetCluster(v string) {
o.Cluster = &v
}
// GetConnectedAt returns the ConnectedAt field value if set, zero value otherwise.
func (o *SandboxSandbox) GetConnectedAt() int64 {
if o == nil || IsNil(o.ConnectedAt) {
var ret int64
return ret
}
return *o.ConnectedAt
}
// GetConnectedAtOk returns a tuple with the ConnectedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxSandbox) GetConnectedAtOk() (*int64, bool) {
if o == nil || IsNil(o.ConnectedAt) {
return nil, false
}
return o.ConnectedAt, true
}
// HasConnectedAt returns a boolean if a field has been set.
func (o *SandboxSandbox) HasConnectedAt() bool {
if o != nil && !IsNil(o.ConnectedAt) {
return true
}
return false
}
// SetConnectedAt gets a reference to the given int64 and assigns it to the ConnectedAt field.
func (o *SandboxSandbox) SetConnectedAt(v int64) {
o.ConnectedAt = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *SandboxSandbox) GetCreatedAt() int64 {
if o == nil || IsNil(o.CreatedAt) {
var ret int64
return ret
}
return *o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxSandbox) GetCreatedAtOk() (*int64, bool) {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *SandboxSandbox) HasCreatedAt() bool {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given int64 and assigns it to the CreatedAt field.
func (o *SandboxSandbox) SetCreatedAt(v int64) {
o.CreatedAt = &v
}
// GetError returns the Error field value if set, zero value otherwise.
func (o *SandboxSandbox) GetError() string {
if o == nil || IsNil(o.Error) {
var ret string
return ret
}
return *o.Error
}
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxSandbox) GetErrorOk() (*string, bool) {
if o == nil || IsNil(o.Error) {
return nil, false
}
return o.Error, true
}
// HasError returns a boolean if a field has been set.
func (o *SandboxSandbox) HasError() bool {
if o != nil && !IsNil(o.Error) {
return true
}
return false
}
// SetError gets a reference to the given string and assigns it to the Error field.
func (o *SandboxSandbox) SetError(v string) {
o.Error = &v
}
// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise.
func (o *SandboxSandbox) GetExpiresAt() int64 {
if o == nil || IsNil(o.ExpiresAt) {
var ret int64
return ret
}
return *o.ExpiresAt
}
// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxSandbox) GetExpiresAtOk() (*int64, bool) {
if o == nil || IsNil(o.ExpiresAt) {
return nil, false
}
return o.ExpiresAt, true
}
// HasExpiresAt returns a boolean if a field has been set.
func (o *SandboxSandbox) HasExpiresAt() bool {
if o != nil && !IsNil(o.ExpiresAt) {
return true
}
return false
}
// SetExpiresAt gets a reference to the given int64 and assigns it to the ExpiresAt field.
func (o *SandboxSandbox) SetExpiresAt(v int64) {
o.ExpiresAt = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *SandboxSandbox) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxSandbox) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *SandboxSandbox) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *SandboxSandbox) SetId(v string) {
o.Id = &v
}
// GetImage returns the Image field value if set, zero value otherwise.
func (o *SandboxSandbox) GetImage() string {
if o == nil || IsNil(o.Image) {
var ret string
return ret
}
return *o.Image
}
// GetImageOk returns a tuple with the Image field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxSandbox) GetImageOk() (*string, bool) {
if o == nil || IsNil(o.Image) {
return nil, false
}
return o.Image, true
}
// HasImage returns a boolean if a field has been set.
func (o *SandboxSandbox) HasImage() bool {
if o != nil && !IsNil(o.Image) {
return true
}
return false
}
// SetImage gets a reference to the given string and assigns it to the Image field.
func (o *SandboxSandbox) SetImage(v string) {
o.Image = &v
}
// GetKind returns the Kind field value if set, zero value otherwise.
func (o *SandboxSandbox) GetKind() string {
if o == nil || IsNil(o.Kind) {
var ret string
return ret
}
return *o.Kind
}
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxSandbox) GetKindOk() (*string, bool) {
if o == nil || IsNil(o.Kind) {
return nil, false
}
return o.Kind, true
}
// HasKind returns a boolean if a field has been set.
func (o *SandboxSandbox) HasKind() bool {
if o != nil && !IsNil(o.Kind) {
return true
}
return false
}
// SetKind gets a reference to the given string and assigns it to the Kind field.
func (o *SandboxSandbox) SetKind(v string) {
o.Kind = &v
}
// GetLastUsedAt returns the LastUsedAt field value if set, zero value otherwise.
func (o *SandboxSandbox) GetLastUsedAt() int64 {
if o == nil || IsNil(o.LastUsedAt) {
var ret int64
return ret
}
return *o.LastUsedAt
}
// GetLastUsedAtOk returns a tuple with the LastUsedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxSandbox) GetLastUsedAtOk() (*int64, bool) {
if o == nil || IsNil(o.LastUsedAt) {
return nil, false
}
return o.LastUsedAt, true
}
// HasLastUsedAt returns a boolean if a field has been set.
func (o *SandboxSandbox) HasLastUsedAt() bool {
if o != nil && !IsNil(o.LastUsedAt) {
return true
}
return false
}
// SetLastUsedAt gets a reference to the given int64 and assigns it to the LastUsedAt field.
func (o *SandboxSandbox) SetLastUsedAt(v int64) {
o.LastUsedAt = &v
}
// GetOrg returns the Org field value if set, zero value otherwise.
func (o *SandboxSandbox) GetOrg() string {
if o == nil || IsNil(o.Org) {
var ret string
return ret
}
return *o.Org
}
// GetOrgOk returns a tuple with the Org field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxSandbox) GetOrgOk() (*string, bool) {
if o == nil || IsNil(o.Org) {
return nil, false
}
return o.Org, true
}
// HasOrg returns a boolean if a field has been set.
func (o *SandboxSandbox) HasOrg() bool {
if o != nil && !IsNil(o.Org) {
return true
}
return false
}
// SetOrg gets a reference to the given string and assigns it to the Org field.
func (o *SandboxSandbox) SetOrg(v string) {
o.Org = &v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *SandboxSandbox) GetProject() string {
if o == nil || IsNil(o.Project) {
var ret string
return ret
}
return *o.Project
}
// GetProjectOk returns a tuple with the Project field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxSandbox) GetProjectOk() (*string, bool) {
if o == nil || IsNil(o.Project) {
return nil, false
}
return o.Project, true
}
// HasProject returns a boolean if a field has been set.
func (o *SandboxSandbox) HasProject() bool {
if o != nil && !IsNil(o.Project) {
return true
}
return false
}
// SetProject gets a reference to the given string and assigns it to the Project field.
func (o *SandboxSandbox) SetProject(v string) {
o.Project = &v
}
// GetRuntime returns the Runtime field value if set, zero value otherwise.
func (o *SandboxSandbox) GetRuntime() string {
if o == nil || IsNil(o.Runtime) {
var ret string
return ret
}
return *o.Runtime
}
// GetRuntimeOk returns a tuple with the Runtime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxSandbox) GetRuntimeOk() (*string, bool) {
if o == nil || IsNil(o.Runtime) {
return nil, false
}
return o.Runtime, true
}
// HasRuntime returns a boolean if a field has been set.
func (o *SandboxSandbox) HasRuntime() bool {
if o != nil && !IsNil(o.Runtime) {
return true
}
return false
}
// SetRuntime gets a reference to the given string and assigns it to the Runtime field.
func (o *SandboxSandbox) SetRuntime(v string) {
o.Runtime = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *SandboxSandbox) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxSandbox) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *SandboxSandbox) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *SandboxSandbox) SetStatus(v string) {
o.Status = &v
}
// GetVolume returns the Volume field value if set, zero value otherwise.
func (o *SandboxSandbox) GetVolume() string {
if o == nil || IsNil(o.Volume) {
var ret string
return ret
}
return *o.Volume
}
// GetVolumeOk returns a tuple with the Volume field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SandboxSandbox) GetVolumeOk() (*string, bool) {
if o == nil || IsNil(o.Volume) {
return nil, false
}
return o.Volume, true
}
// HasVolume returns a boolean if a field has been set.
func (o *SandboxSandbox) HasVolume() bool {
if o != nil && !IsNil(o.Volume) {
return true
}
return false
}
// SetVolume gets a reference to the given string and assigns it to the Volume field.
func (o *SandboxSandbox) SetVolume(v string) {
o.Volume = &v
}
func (o SandboxSandbox) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SandboxSandbox) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Actor) {
toSerialize["actor"] = o.Actor
}
if !IsNil(o.Class) {
toSerialize["class"] = o.Class
}
if !IsNil(o.Cluster) {
toSerialize["cluster"] = o.Cluster
}
if !IsNil(o.ConnectedAt) {
toSerialize["connectedAt"] = o.ConnectedAt
}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.Error) {
toSerialize["error"] = o.Error
}
if !IsNil(o.ExpiresAt) {
toSerialize["expiresAt"] = o.ExpiresAt
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Image) {
toSerialize["image"] = o.Image
}
if !IsNil(o.Kind) {
toSerialize["kind"] = o.Kind
}
if !IsNil(o.LastUsedAt) {
toSerialize["lastUsedAt"] = o.LastUsedAt
}
if !IsNil(o.Org) {
toSerialize["org"] = o.Org
}
if !IsNil(o.Project) {
toSerialize["project"] = o.Project
}
if !IsNil(o.Runtime) {
toSerialize["runtime"] = o.Runtime
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Volume) {
toSerialize["volume"] = o.Volume
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *SandboxSandbox) UnmarshalJSON(data []byte) (err error) {
varSandboxSandbox := _SandboxSandbox{}
err = json.Unmarshal(data, &varSandboxSandbox)
if err != nil {
return err
}
*o = SandboxSandbox(varSandboxSandbox)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "actor")
delete(additionalProperties, "class")
delete(additionalProperties, "cluster")
delete(additionalProperties, "connectedAt")
delete(additionalProperties, "createdAt")
delete(additionalProperties, "error")
delete(additionalProperties, "expiresAt")
delete(additionalProperties, "id")
delete(additionalProperties, "image")
delete(additionalProperties, "kind")
delete(additionalProperties, "lastUsedAt")
delete(additionalProperties, "org")
delete(additionalProperties, "project")
delete(additionalProperties, "runtime")
delete(additionalProperties, "status")
delete(additionalProperties, "volume")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableSandboxSandbox struct {
value *SandboxSandbox
isSet bool
}
func (v NullableSandboxSandbox) Get() *SandboxSandbox {
return v.value
}
func (v *NullableSandboxSandbox) Set(val *SandboxSandbox) {
v.value = val
v.isSet = true
}
func (v NullableSandboxSandbox) IsSet() bool {
return v.isSet
}
func (v *NullableSandboxSandbox) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSandboxSandbox(val *SandboxSandbox) *NullableSandboxSandbox {
return &NullableSandboxSandbox{value: val, isSet: true}
}
func (v NullableSandboxSandbox) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSandboxSandbox) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}