Files
sdk/model_compute_machine_view.go

725 lines
21 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
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 ComputeMachineView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ComputeMachineView{}
// ComputeMachineView struct for ComputeMachineView
type ComputeMachineView struct {
// Agent is the cloud Agent this machine runs, lifted out of the binding so a list reads without following one. Empty means nothing is bound — for a kind=bot machine that means it costs money and answers nothing.
Agent *string `json:"agent,omitempty"`
// Binding is the record joining this machine to that agent, carrying vm's own reconciled status and its reason. Absent means no runtime is bound, which is also what a stopped bot looks like: stopping unbinds and leaves the machine running.
Binding *ComputeAgentBinding `json:"binding,omitempty"`
// CreatedTime is when the machine came into being: the provider's own creation timestamp for a Visor machine, passed through in whatever form it states it, and for a BYO machine the RFC 3339 moment it first dialed in.
CreatedTime *string `json:"createdTime,omitempty"`
// GPU names the accelerators this machine holds (\"H100\", or \"2× NVIDIA GB10\" for a BYO machine reporting a matched pair). Empty means the machine is not a GPU machine — the size slug does not parse as one, or nvidia-smi found nothing.
Gpu *string `json:"gpu,omitempty"`
// ID addresses this machine on the /v1/compute/machines/:id routes: the org-scoped NAME Visor keys a machine by, falling back to the provider id for a machine that has no name. A BYO machine's is the id it dialed in under.
Id *string `json:"id,omitempty"`
// Image is the OS image the machine booted from, as the provider names it.
Image *string `json:"image,omitempty"`
// Mem is system RAM rendered for a human (\"8 GB\"), not a number to compute with. Empty when the provider's figure is ambiguous, or when the only figure available is a GPU slug's gb — that is VRAM, and reporting it as system RAM would be a fabrication. A BYO machine's RAM is on /v1/compute/fleet/workers.
Mem *string `json:"mem,omitempty"`
// Name is the label to show a human — Visor's displayName, or the machine name when it carries none. A BYO machine's is its hostname. It is not an address: ID is what the routes take.
Name *string `json:"name,omitempty"`
// Os is the operating system on the machine — Visor's record for a provisioned one, the host's own report (linux, darwin, windows) for a BYO one.
Os *string `json:"os,omitempty"`
// PrivateIp is the address on the provider's own network, reachable from the org's other machines in the same region. Empty on the same terms as PublicIp.
PrivateIp *string `json:"privateIp,omitempty"`
// Provider is the cloud that runs the machine (\"digitalocean\"), or \"byo\" for one the operator dialed in with `hanzo link`.
Provider *string `json:"provider,omitempty"`
// PublicIp is the internet-facing address the provider assigned. Empty while a machine is still provisioning, and empty for a BYO machine — it dials out from behind NAT, so no address is ever learned for it.
PublicIp *string `json:"publicIp,omitempty"`
// Region is the provider region slug (\"sfo3\"), or the zone when the provider reports only that. \"on-prem\" for a BYO machine, which has no cloud region.
Region *string `json:"region,omitempty"`
// Status is the lifecycle state in the PROVIDER's own words (\"active\", \"running\", \"off\"), passed through rather than mapped onto a vocabulary of ours. A BYO machine's is \"online\" or \"offline\", decided by whether its last heartbeat is within 90s.
Status *string `json:"status,omitempty"`
// Type is the provider SIZE SLUG the machine runs at (\"s-2vcpu-4gb\", \"gpu-h100x8-640gb\") — the value a launch asks for, and what Vcpu/Mem/GPU are read out of when the provider states them no other way. \"byo-gpu\" for a dialed-in machine, which was never bought from a size catalog.
Type *string `json:"type,omitempty"`
// Vcpu is logical cores — the provider's own cpuSize when that is a clean integer, else the count read out of the size slug (4 from \"s-4vcpu-8gb\"). ABSENT, never 0, when neither says. A BYO machine leaves it absent here; its real core count is on GET /v1/compute/fleet/workers.
Vcpu *int64 `json:"vcpu,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ComputeMachineView ComputeMachineView
// NewComputeMachineView instantiates a new ComputeMachineView 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 NewComputeMachineView() *ComputeMachineView {
this := ComputeMachineView{}
return &this
}
// NewComputeMachineViewWithDefaults instantiates a new ComputeMachineView 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 NewComputeMachineViewWithDefaults() *ComputeMachineView {
this := ComputeMachineView{}
return &this
}
// GetAgent returns the Agent field value if set, zero value otherwise.
func (o *ComputeMachineView) GetAgent() string {
if o == nil || IsNil(o.Agent) {
var ret string
return ret
}
return *o.Agent
}
// GetAgentOk returns a tuple with the Agent field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeMachineView) GetAgentOk() (*string, bool) {
if o == nil || IsNil(o.Agent) {
return nil, false
}
return o.Agent, true
}
// HasAgent returns a boolean if a field has been set.
func (o *ComputeMachineView) HasAgent() bool {
if o != nil && !IsNil(o.Agent) {
return true
}
return false
}
// SetAgent gets a reference to the given string and assigns it to the Agent field.
func (o *ComputeMachineView) SetAgent(v string) {
o.Agent = &v
}
// GetBinding returns the Binding field value if set, zero value otherwise.
func (o *ComputeMachineView) GetBinding() ComputeAgentBinding {
if o == nil || IsNil(o.Binding) {
var ret ComputeAgentBinding
return ret
}
return *o.Binding
}
// GetBindingOk returns a tuple with the Binding field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeMachineView) GetBindingOk() (*ComputeAgentBinding, bool) {
if o == nil || IsNil(o.Binding) {
return nil, false
}
return o.Binding, true
}
// HasBinding returns a boolean if a field has been set.
func (o *ComputeMachineView) HasBinding() bool {
if o != nil && !IsNil(o.Binding) {
return true
}
return false
}
// SetBinding gets a reference to the given ComputeAgentBinding and assigns it to the Binding field.
func (o *ComputeMachineView) SetBinding(v ComputeAgentBinding) {
o.Binding = &v
}
// GetCreatedTime returns the CreatedTime field value if set, zero value otherwise.
func (o *ComputeMachineView) GetCreatedTime() string {
if o == nil || IsNil(o.CreatedTime) {
var ret string
return ret
}
return *o.CreatedTime
}
// GetCreatedTimeOk returns a tuple with the CreatedTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeMachineView) GetCreatedTimeOk() (*string, bool) {
if o == nil || IsNil(o.CreatedTime) {
return nil, false
}
return o.CreatedTime, true
}
// HasCreatedTime returns a boolean if a field has been set.
func (o *ComputeMachineView) HasCreatedTime() bool {
if o != nil && !IsNil(o.CreatedTime) {
return true
}
return false
}
// SetCreatedTime gets a reference to the given string and assigns it to the CreatedTime field.
func (o *ComputeMachineView) SetCreatedTime(v string) {
o.CreatedTime = &v
}
// GetGpu returns the Gpu field value if set, zero value otherwise.
func (o *ComputeMachineView) GetGpu() string {
if o == nil || IsNil(o.Gpu) {
var ret string
return ret
}
return *o.Gpu
}
// GetGpuOk returns a tuple with the Gpu field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeMachineView) GetGpuOk() (*string, bool) {
if o == nil || IsNil(o.Gpu) {
return nil, false
}
return o.Gpu, true
}
// HasGpu returns a boolean if a field has been set.
func (o *ComputeMachineView) HasGpu() bool {
if o != nil && !IsNil(o.Gpu) {
return true
}
return false
}
// SetGpu gets a reference to the given string and assigns it to the Gpu field.
func (o *ComputeMachineView) SetGpu(v string) {
o.Gpu = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *ComputeMachineView) 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 *ComputeMachineView) 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 *ComputeMachineView) 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 *ComputeMachineView) SetId(v string) {
o.Id = &v
}
// GetImage returns the Image field value if set, zero value otherwise.
func (o *ComputeMachineView) 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 *ComputeMachineView) 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 *ComputeMachineView) 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 *ComputeMachineView) SetImage(v string) {
o.Image = &v
}
// GetMem returns the Mem field value if set, zero value otherwise.
func (o *ComputeMachineView) GetMem() string {
if o == nil || IsNil(o.Mem) {
var ret string
return ret
}
return *o.Mem
}
// GetMemOk returns a tuple with the Mem field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeMachineView) GetMemOk() (*string, bool) {
if o == nil || IsNil(o.Mem) {
return nil, false
}
return o.Mem, true
}
// HasMem returns a boolean if a field has been set.
func (o *ComputeMachineView) HasMem() bool {
if o != nil && !IsNil(o.Mem) {
return true
}
return false
}
// SetMem gets a reference to the given string and assigns it to the Mem field.
func (o *ComputeMachineView) SetMem(v string) {
o.Mem = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ComputeMachineView) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeMachineView) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *ComputeMachineView) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *ComputeMachineView) SetName(v string) {
o.Name = &v
}
// GetOs returns the Os field value if set, zero value otherwise.
func (o *ComputeMachineView) GetOs() string {
if o == nil || IsNil(o.Os) {
var ret string
return ret
}
return *o.Os
}
// GetOsOk returns a tuple with the Os field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeMachineView) GetOsOk() (*string, bool) {
if o == nil || IsNil(o.Os) {
return nil, false
}
return o.Os, true
}
// HasOs returns a boolean if a field has been set.
func (o *ComputeMachineView) HasOs() bool {
if o != nil && !IsNil(o.Os) {
return true
}
return false
}
// SetOs gets a reference to the given string and assigns it to the Os field.
func (o *ComputeMachineView) SetOs(v string) {
o.Os = &v
}
// GetPrivateIp returns the PrivateIp field value if set, zero value otherwise.
func (o *ComputeMachineView) GetPrivateIp() string {
if o == nil || IsNil(o.PrivateIp) {
var ret string
return ret
}
return *o.PrivateIp
}
// GetPrivateIpOk returns a tuple with the PrivateIp field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeMachineView) GetPrivateIpOk() (*string, bool) {
if o == nil || IsNil(o.PrivateIp) {
return nil, false
}
return o.PrivateIp, true
}
// HasPrivateIp returns a boolean if a field has been set.
func (o *ComputeMachineView) HasPrivateIp() bool {
if o != nil && !IsNil(o.PrivateIp) {
return true
}
return false
}
// SetPrivateIp gets a reference to the given string and assigns it to the PrivateIp field.
func (o *ComputeMachineView) SetPrivateIp(v string) {
o.PrivateIp = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *ComputeMachineView) GetProvider() string {
if o == nil || IsNil(o.Provider) {
var ret string
return ret
}
return *o.Provider
}
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeMachineView) GetProviderOk() (*string, bool) {
if o == nil || IsNil(o.Provider) {
return nil, false
}
return o.Provider, true
}
// HasProvider returns a boolean if a field has been set.
func (o *ComputeMachineView) HasProvider() bool {
if o != nil && !IsNil(o.Provider) {
return true
}
return false
}
// SetProvider gets a reference to the given string and assigns it to the Provider field.
func (o *ComputeMachineView) SetProvider(v string) {
o.Provider = &v
}
// GetPublicIp returns the PublicIp field value if set, zero value otherwise.
func (o *ComputeMachineView) GetPublicIp() string {
if o == nil || IsNil(o.PublicIp) {
var ret string
return ret
}
return *o.PublicIp
}
// GetPublicIpOk returns a tuple with the PublicIp field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeMachineView) GetPublicIpOk() (*string, bool) {
if o == nil || IsNil(o.PublicIp) {
return nil, false
}
return o.PublicIp, true
}
// HasPublicIp returns a boolean if a field has been set.
func (o *ComputeMachineView) HasPublicIp() bool {
if o != nil && !IsNil(o.PublicIp) {
return true
}
return false
}
// SetPublicIp gets a reference to the given string and assigns it to the PublicIp field.
func (o *ComputeMachineView) SetPublicIp(v string) {
o.PublicIp = &v
}
// GetRegion returns the Region field value if set, zero value otherwise.
func (o *ComputeMachineView) GetRegion() string {
if o == nil || IsNil(o.Region) {
var ret string
return ret
}
return *o.Region
}
// GetRegionOk returns a tuple with the Region field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeMachineView) GetRegionOk() (*string, bool) {
if o == nil || IsNil(o.Region) {
return nil, false
}
return o.Region, true
}
// HasRegion returns a boolean if a field has been set.
func (o *ComputeMachineView) HasRegion() bool {
if o != nil && !IsNil(o.Region) {
return true
}
return false
}
// SetRegion gets a reference to the given string and assigns it to the Region field.
func (o *ComputeMachineView) SetRegion(v string) {
o.Region = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *ComputeMachineView) 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 *ComputeMachineView) 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 *ComputeMachineView) 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 *ComputeMachineView) SetStatus(v string) {
o.Status = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *ComputeMachineView) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeMachineView) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *ComputeMachineView) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *ComputeMachineView) SetType(v string) {
o.Type = &v
}
// GetVcpu returns the Vcpu field value if set, zero value otherwise.
func (o *ComputeMachineView) GetVcpu() int64 {
if o == nil || IsNil(o.Vcpu) {
var ret int64
return ret
}
return *o.Vcpu
}
// GetVcpuOk returns a tuple with the Vcpu field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeMachineView) GetVcpuOk() (*int64, bool) {
if o == nil || IsNil(o.Vcpu) {
return nil, false
}
return o.Vcpu, true
}
// HasVcpu returns a boolean if a field has been set.
func (o *ComputeMachineView) HasVcpu() bool {
if o != nil && !IsNil(o.Vcpu) {
return true
}
return false
}
// SetVcpu gets a reference to the given int64 and assigns it to the Vcpu field.
func (o *ComputeMachineView) SetVcpu(v int64) {
o.Vcpu = &v
}
func (o ComputeMachineView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ComputeMachineView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Agent) {
toSerialize["agent"] = o.Agent
}
if !IsNil(o.Binding) {
toSerialize["binding"] = o.Binding
}
if !IsNil(o.CreatedTime) {
toSerialize["createdTime"] = o.CreatedTime
}
if !IsNil(o.Gpu) {
toSerialize["gpu"] = o.Gpu
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Image) {
toSerialize["image"] = o.Image
}
if !IsNil(o.Mem) {
toSerialize["mem"] = o.Mem
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Os) {
toSerialize["os"] = o.Os
}
if !IsNil(o.PrivateIp) {
toSerialize["privateIp"] = o.PrivateIp
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
if !IsNil(o.PublicIp) {
toSerialize["publicIp"] = o.PublicIp
}
if !IsNil(o.Region) {
toSerialize["region"] = o.Region
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
if !IsNil(o.Vcpu) {
toSerialize["vcpu"] = o.Vcpu
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ComputeMachineView) UnmarshalJSON(data []byte) (err error) {
varComputeMachineView := _ComputeMachineView{}
err = json.Unmarshal(data, &varComputeMachineView)
if err != nil {
return err
}
*o = ComputeMachineView(varComputeMachineView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "agent")
delete(additionalProperties, "binding")
delete(additionalProperties, "createdTime")
delete(additionalProperties, "gpu")
delete(additionalProperties, "id")
delete(additionalProperties, "image")
delete(additionalProperties, "mem")
delete(additionalProperties, "name")
delete(additionalProperties, "os")
delete(additionalProperties, "privateIp")
delete(additionalProperties, "provider")
delete(additionalProperties, "publicIp")
delete(additionalProperties, "region")
delete(additionalProperties, "status")
delete(additionalProperties, "type")
delete(additionalProperties, "vcpu")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableComputeMachineView struct {
value *ComputeMachineView
isSet bool
}
func (v NullableComputeMachineView) Get() *ComputeMachineView {
return v.value
}
func (v *NullableComputeMachineView) Set(val *ComputeMachineView) {
v.value = val
v.isSet = true
}
func (v NullableComputeMachineView) IsSet() bool {
return v.isSet
}
func (v *NullableComputeMachineView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableComputeMachineView(val *ComputeMachineView) *NullableComputeMachineView {
return &NullableComputeMachineView{value: val, isSet: true}
}
func (v NullableComputeMachineView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableComputeMachineView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}