Files
sdk/model_compute_byo_worker.go

991 lines
28 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 ComputeByoWorker type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ComputeByoWorker{}
// ComputeByoWorker struct for ComputeByoWorker
type ComputeByoWorker struct {
// Arch/CPUs/Memory are the connecting host's static CPU spec, mirrored from the registration: Arch is runtime.GOARCH (amd64 | arm64), Memory is total RAM in BYTES — the same fields a code-linked run-target carries, so the /v1/compute/fleet board renders a linked node's arch + cores + RAM like any other unit.
Arch *string `json:"arch,omitempty"`
// Capabilities is what this worker offers the org: \"studio.render\" when the node can render, \"engine.serve\" when it serves a model endpoint. A node advertises one only once it can honour it, so an absent list means a node that has dialed in but is not ready to serve any of them yet.
Capabilities []string `json:"capabilities,omitempty"`
// CPUModel is the processor as the host names it (\"Apple M3 Max\"), for display.
CpuModel *string `json:"cpuModel,omitempty"`
// CPUs is the host's logical core count.
Cpus *int64 `json:"cpus,omitempty"`
// Cuda is the host's CUDA toolkit version. NVIDIA hosts report it.
Cuda *string `json:"cuda,omitempty"`
// Driver is the host's NVIDIA kernel driver version — distinct from Cuda, and the one that bounds which CUDA versions can run on this box.
Driver *string `json:"driver,omitempty"`
// Engine is the hanzo-engine model server this node runs, when it runs one (`hanzo link --serve-engine`). Absent means the node takes jobs but serves no model endpoint.
Engine *ComputeEngineAdvertisement `json:"engine,omitempty"`
// FirstSeen is when this node first dialed in, RFC 3339 — the start of its presence record, which `hanzo unlink` ends.
FirstSeen *string `json:"firstSeen,omitempty"`
// GPUs are the accelerators the host found on itself. Empty is a real answer: a CPU-only machine can dial in and take non-GPU work.
Gpus []ComputeByoGPU `json:"gpus,omitempty"`
// Hip is the host's HIP runtime version, the AMD counterpart to Cuda.
Hip *string `json:"hip,omitempty"`
// Hostname is what the host calls itself. It equals ID for any hostname already in the [a-z0-9-] alphabet, and differs when sanitizing had to change it.
Hostname *string `json:"hostname,omitempty"`
// ID is the node's id in the fleet — the sanitized hostname it registered under, which is also the `unit` its samples and its gpu-jobs lane key on. This is the id to use everywhere else on the compute surface.
Id *string `json:"id,omitempty"`
// JobQueue is the tasks NAMESPACE this worker claims render jobs out of — \"gpu-jobs\" unless `hanzo link` was pointed at another. Within it, a job aimed at this node alone rides the task-queue value \"gpu:<id>\".
JobQueue *string `json:"jobQueue,omitempty"`
// Lanes are the Studio render lanes the node's engine can run now (image.zen, edit.qwen, video.wan, mesh, ...): advertised only when every weight file a lane loads is on the node, so a page offers a GPU card only where it renders.
Lanes []string `json:"lanes,omitempty"`
// LastHeartbeat is the most recent beat this node sent, RFC 3339. It is what Status is computed from, so a reader can check the judgement.
LastHeartbeat *string `json:"lastHeartbeat,omitempty"`
// Location is always \"on-prem\" — a machine that dialed in has no cloud region, and inventing one would put it somewhere it is not.
Location *string `json:"location,omitempty"`
// Memory is the host's total RAM in BYTES.
Memory *int64 `json:"memory,omitempty"`
// Models are the weights behind those lanes, each with its SPDX licence.
Models []ComputeLaneModel `json:"models,omitempty"`
// Os is the host's operating system: linux, darwin or windows.
Os *string `json:"os,omitempty"`
// Provider is always \"byo\": this machine is the operator's, not one Hanzo provisioned. It exists so a fold into the machines/GPUs pages says which rows are rented and which are the customer's own.
Provider *string `json:"provider,omitempty"`
// Rocm is the host's ROCm version. AMD hosts report it; empty otherwise.
Rocm *string `json:"rocm,omitempty"`
// Status is \"online\" when the last heartbeat landed within 90s, else \"offline\" — so it is a fact about heartbeat freshness, not about the box being powered on. A worker that has never beaten reads offline.
Status *string `json:"status,omitempty"`
// Version is the `hanzo` CLI version running on the node. It is what to check when a worker is missing a field a newer registration reports.
Version *string `json:"version,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ComputeByoWorker ComputeByoWorker
// NewComputeByoWorker instantiates a new ComputeByoWorker 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 NewComputeByoWorker() *ComputeByoWorker {
this := ComputeByoWorker{}
return &this
}
// NewComputeByoWorkerWithDefaults instantiates a new ComputeByoWorker 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 NewComputeByoWorkerWithDefaults() *ComputeByoWorker {
this := ComputeByoWorker{}
return &this
}
// GetArch returns the Arch field value if set, zero value otherwise.
func (o *ComputeByoWorker) GetArch() string {
if o == nil || IsNil(o.Arch) {
var ret string
return ret
}
return *o.Arch
}
// GetArchOk returns a tuple with the Arch field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeByoWorker) GetArchOk() (*string, bool) {
if o == nil || IsNil(o.Arch) {
return nil, false
}
return o.Arch, true
}
// HasArch returns a boolean if a field has been set.
func (o *ComputeByoWorker) HasArch() bool {
if o != nil && !IsNil(o.Arch) {
return true
}
return false
}
// SetArch gets a reference to the given string and assigns it to the Arch field.
func (o *ComputeByoWorker) SetArch(v string) {
o.Arch = &v
}
// GetCapabilities returns the Capabilities field value if set, zero value otherwise.
func (o *ComputeByoWorker) GetCapabilities() []string {
if o == nil || IsNil(o.Capabilities) {
var ret []string
return ret
}
return o.Capabilities
}
// GetCapabilitiesOk returns a tuple with the Capabilities field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeByoWorker) GetCapabilitiesOk() ([]string, bool) {
if o == nil || IsNil(o.Capabilities) {
return nil, false
}
return o.Capabilities, true
}
// HasCapabilities returns a boolean if a field has been set.
func (o *ComputeByoWorker) HasCapabilities() bool {
if o != nil && !IsNil(o.Capabilities) {
return true
}
return false
}
// SetCapabilities gets a reference to the given []string and assigns it to the Capabilities field.
func (o *ComputeByoWorker) SetCapabilities(v []string) {
o.Capabilities = v
}
// GetCpuModel returns the CpuModel field value if set, zero value otherwise.
func (o *ComputeByoWorker) GetCpuModel() string {
if o == nil || IsNil(o.CpuModel) {
var ret string
return ret
}
return *o.CpuModel
}
// GetCpuModelOk returns a tuple with the CpuModel field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeByoWorker) GetCpuModelOk() (*string, bool) {
if o == nil || IsNil(o.CpuModel) {
return nil, false
}
return o.CpuModel, true
}
// HasCpuModel returns a boolean if a field has been set.
func (o *ComputeByoWorker) HasCpuModel() bool {
if o != nil && !IsNil(o.CpuModel) {
return true
}
return false
}
// SetCpuModel gets a reference to the given string and assigns it to the CpuModel field.
func (o *ComputeByoWorker) SetCpuModel(v string) {
o.CpuModel = &v
}
// GetCpus returns the Cpus field value if set, zero value otherwise.
func (o *ComputeByoWorker) GetCpus() int64 {
if o == nil || IsNil(o.Cpus) {
var ret int64
return ret
}
return *o.Cpus
}
// GetCpusOk returns a tuple with the Cpus field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeByoWorker) GetCpusOk() (*int64, bool) {
if o == nil || IsNil(o.Cpus) {
return nil, false
}
return o.Cpus, true
}
// HasCpus returns a boolean if a field has been set.
func (o *ComputeByoWorker) HasCpus() bool {
if o != nil && !IsNil(o.Cpus) {
return true
}
return false
}
// SetCpus gets a reference to the given int64 and assigns it to the Cpus field.
func (o *ComputeByoWorker) SetCpus(v int64) {
o.Cpus = &v
}
// GetCuda returns the Cuda field value if set, zero value otherwise.
func (o *ComputeByoWorker) GetCuda() string {
if o == nil || IsNil(o.Cuda) {
var ret string
return ret
}
return *o.Cuda
}
// GetCudaOk returns a tuple with the Cuda field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeByoWorker) GetCudaOk() (*string, bool) {
if o == nil || IsNil(o.Cuda) {
return nil, false
}
return o.Cuda, true
}
// HasCuda returns a boolean if a field has been set.
func (o *ComputeByoWorker) HasCuda() bool {
if o != nil && !IsNil(o.Cuda) {
return true
}
return false
}
// SetCuda gets a reference to the given string and assigns it to the Cuda field.
func (o *ComputeByoWorker) SetCuda(v string) {
o.Cuda = &v
}
// GetDriver returns the Driver field value if set, zero value otherwise.
func (o *ComputeByoWorker) GetDriver() string {
if o == nil || IsNil(o.Driver) {
var ret string
return ret
}
return *o.Driver
}
// GetDriverOk returns a tuple with the Driver field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeByoWorker) GetDriverOk() (*string, bool) {
if o == nil || IsNil(o.Driver) {
return nil, false
}
return o.Driver, true
}
// HasDriver returns a boolean if a field has been set.
func (o *ComputeByoWorker) HasDriver() bool {
if o != nil && !IsNil(o.Driver) {
return true
}
return false
}
// SetDriver gets a reference to the given string and assigns it to the Driver field.
func (o *ComputeByoWorker) SetDriver(v string) {
o.Driver = &v
}
// GetEngine returns the Engine field value if set, zero value otherwise.
func (o *ComputeByoWorker) GetEngine() ComputeEngineAdvertisement {
if o == nil || IsNil(o.Engine) {
var ret ComputeEngineAdvertisement
return ret
}
return *o.Engine
}
// GetEngineOk returns a tuple with the Engine field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeByoWorker) GetEngineOk() (*ComputeEngineAdvertisement, bool) {
if o == nil || IsNil(o.Engine) {
return nil, false
}
return o.Engine, true
}
// HasEngine returns a boolean if a field has been set.
func (o *ComputeByoWorker) HasEngine() bool {
if o != nil && !IsNil(o.Engine) {
return true
}
return false
}
// SetEngine gets a reference to the given ComputeEngineAdvertisement and assigns it to the Engine field.
func (o *ComputeByoWorker) SetEngine(v ComputeEngineAdvertisement) {
o.Engine = &v
}
// GetFirstSeen returns the FirstSeen field value if set, zero value otherwise.
func (o *ComputeByoWorker) GetFirstSeen() string {
if o == nil || IsNil(o.FirstSeen) {
var ret string
return ret
}
return *o.FirstSeen
}
// GetFirstSeenOk returns a tuple with the FirstSeen field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeByoWorker) GetFirstSeenOk() (*string, bool) {
if o == nil || IsNil(o.FirstSeen) {
return nil, false
}
return o.FirstSeen, true
}
// HasFirstSeen returns a boolean if a field has been set.
func (o *ComputeByoWorker) HasFirstSeen() bool {
if o != nil && !IsNil(o.FirstSeen) {
return true
}
return false
}
// SetFirstSeen gets a reference to the given string and assigns it to the FirstSeen field.
func (o *ComputeByoWorker) SetFirstSeen(v string) {
o.FirstSeen = &v
}
// GetGpus returns the Gpus field value if set, zero value otherwise.
func (o *ComputeByoWorker) GetGpus() []ComputeByoGPU {
if o == nil || IsNil(o.Gpus) {
var ret []ComputeByoGPU
return ret
}
return o.Gpus
}
// GetGpusOk returns a tuple with the Gpus field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeByoWorker) GetGpusOk() ([]ComputeByoGPU, bool) {
if o == nil || IsNil(o.Gpus) {
return nil, false
}
return o.Gpus, true
}
// HasGpus returns a boolean if a field has been set.
func (o *ComputeByoWorker) HasGpus() bool {
if o != nil && !IsNil(o.Gpus) {
return true
}
return false
}
// SetGpus gets a reference to the given []ComputeByoGPU and assigns it to the Gpus field.
func (o *ComputeByoWorker) SetGpus(v []ComputeByoGPU) {
o.Gpus = v
}
// GetHip returns the Hip field value if set, zero value otherwise.
func (o *ComputeByoWorker) GetHip() string {
if o == nil || IsNil(o.Hip) {
var ret string
return ret
}
return *o.Hip
}
// GetHipOk returns a tuple with the Hip field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeByoWorker) GetHipOk() (*string, bool) {
if o == nil || IsNil(o.Hip) {
return nil, false
}
return o.Hip, true
}
// HasHip returns a boolean if a field has been set.
func (o *ComputeByoWorker) HasHip() bool {
if o != nil && !IsNil(o.Hip) {
return true
}
return false
}
// SetHip gets a reference to the given string and assigns it to the Hip field.
func (o *ComputeByoWorker) SetHip(v string) {
o.Hip = &v
}
// GetHostname returns the Hostname field value if set, zero value otherwise.
func (o *ComputeByoWorker) GetHostname() string {
if o == nil || IsNil(o.Hostname) {
var ret string
return ret
}
return *o.Hostname
}
// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeByoWorker) GetHostnameOk() (*string, bool) {
if o == nil || IsNil(o.Hostname) {
return nil, false
}
return o.Hostname, true
}
// HasHostname returns a boolean if a field has been set.
func (o *ComputeByoWorker) HasHostname() bool {
if o != nil && !IsNil(o.Hostname) {
return true
}
return false
}
// SetHostname gets a reference to the given string and assigns it to the Hostname field.
func (o *ComputeByoWorker) SetHostname(v string) {
o.Hostname = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *ComputeByoWorker) 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 *ComputeByoWorker) 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 *ComputeByoWorker) 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 *ComputeByoWorker) SetId(v string) {
o.Id = &v
}
// GetJobQueue returns the JobQueue field value if set, zero value otherwise.
func (o *ComputeByoWorker) GetJobQueue() string {
if o == nil || IsNil(o.JobQueue) {
var ret string
return ret
}
return *o.JobQueue
}
// GetJobQueueOk returns a tuple with the JobQueue field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeByoWorker) GetJobQueueOk() (*string, bool) {
if o == nil || IsNil(o.JobQueue) {
return nil, false
}
return o.JobQueue, true
}
// HasJobQueue returns a boolean if a field has been set.
func (o *ComputeByoWorker) HasJobQueue() bool {
if o != nil && !IsNil(o.JobQueue) {
return true
}
return false
}
// SetJobQueue gets a reference to the given string and assigns it to the JobQueue field.
func (o *ComputeByoWorker) SetJobQueue(v string) {
o.JobQueue = &v
}
// GetLanes returns the Lanes field value if set, zero value otherwise.
func (o *ComputeByoWorker) GetLanes() []string {
if o == nil || IsNil(o.Lanes) {
var ret []string
return ret
}
return o.Lanes
}
// GetLanesOk returns a tuple with the Lanes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeByoWorker) GetLanesOk() ([]string, bool) {
if o == nil || IsNil(o.Lanes) {
return nil, false
}
return o.Lanes, true
}
// HasLanes returns a boolean if a field has been set.
func (o *ComputeByoWorker) HasLanes() bool {
if o != nil && !IsNil(o.Lanes) {
return true
}
return false
}
// SetLanes gets a reference to the given []string and assigns it to the Lanes field.
func (o *ComputeByoWorker) SetLanes(v []string) {
o.Lanes = v
}
// GetLastHeartbeat returns the LastHeartbeat field value if set, zero value otherwise.
func (o *ComputeByoWorker) GetLastHeartbeat() string {
if o == nil || IsNil(o.LastHeartbeat) {
var ret string
return ret
}
return *o.LastHeartbeat
}
// GetLastHeartbeatOk returns a tuple with the LastHeartbeat field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeByoWorker) GetLastHeartbeatOk() (*string, bool) {
if o == nil || IsNil(o.LastHeartbeat) {
return nil, false
}
return o.LastHeartbeat, true
}
// HasLastHeartbeat returns a boolean if a field has been set.
func (o *ComputeByoWorker) HasLastHeartbeat() bool {
if o != nil && !IsNil(o.LastHeartbeat) {
return true
}
return false
}
// SetLastHeartbeat gets a reference to the given string and assigns it to the LastHeartbeat field.
func (o *ComputeByoWorker) SetLastHeartbeat(v string) {
o.LastHeartbeat = &v
}
// GetLocation returns the Location field value if set, zero value otherwise.
func (o *ComputeByoWorker) GetLocation() string {
if o == nil || IsNil(o.Location) {
var ret string
return ret
}
return *o.Location
}
// GetLocationOk returns a tuple with the Location field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeByoWorker) GetLocationOk() (*string, bool) {
if o == nil || IsNil(o.Location) {
return nil, false
}
return o.Location, true
}
// HasLocation returns a boolean if a field has been set.
func (o *ComputeByoWorker) HasLocation() bool {
if o != nil && !IsNil(o.Location) {
return true
}
return false
}
// SetLocation gets a reference to the given string and assigns it to the Location field.
func (o *ComputeByoWorker) SetLocation(v string) {
o.Location = &v
}
// GetMemory returns the Memory field value if set, zero value otherwise.
func (o *ComputeByoWorker) GetMemory() int64 {
if o == nil || IsNil(o.Memory) {
var ret int64
return ret
}
return *o.Memory
}
// GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeByoWorker) GetMemoryOk() (*int64, bool) {
if o == nil || IsNil(o.Memory) {
return nil, false
}
return o.Memory, true
}
// HasMemory returns a boolean if a field has been set.
func (o *ComputeByoWorker) HasMemory() bool {
if o != nil && !IsNil(o.Memory) {
return true
}
return false
}
// SetMemory gets a reference to the given int64 and assigns it to the Memory field.
func (o *ComputeByoWorker) SetMemory(v int64) {
o.Memory = &v
}
// GetModels returns the Models field value if set, zero value otherwise.
func (o *ComputeByoWorker) GetModels() []ComputeLaneModel {
if o == nil || IsNil(o.Models) {
var ret []ComputeLaneModel
return ret
}
return o.Models
}
// GetModelsOk returns a tuple with the Models field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeByoWorker) GetModelsOk() ([]ComputeLaneModel, bool) {
if o == nil || IsNil(o.Models) {
return nil, false
}
return o.Models, true
}
// HasModels returns a boolean if a field has been set.
func (o *ComputeByoWorker) HasModels() bool {
if o != nil && !IsNil(o.Models) {
return true
}
return false
}
// SetModels gets a reference to the given []ComputeLaneModel and assigns it to the Models field.
func (o *ComputeByoWorker) SetModels(v []ComputeLaneModel) {
o.Models = v
}
// GetOs returns the Os field value if set, zero value otherwise.
func (o *ComputeByoWorker) 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 *ComputeByoWorker) 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 *ComputeByoWorker) 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 *ComputeByoWorker) SetOs(v string) {
o.Os = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *ComputeByoWorker) 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 *ComputeByoWorker) 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 *ComputeByoWorker) 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 *ComputeByoWorker) SetProvider(v string) {
o.Provider = &v
}
// GetRocm returns the Rocm field value if set, zero value otherwise.
func (o *ComputeByoWorker) GetRocm() string {
if o == nil || IsNil(o.Rocm) {
var ret string
return ret
}
return *o.Rocm
}
// GetRocmOk returns a tuple with the Rocm field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeByoWorker) GetRocmOk() (*string, bool) {
if o == nil || IsNil(o.Rocm) {
return nil, false
}
return o.Rocm, true
}
// HasRocm returns a boolean if a field has been set.
func (o *ComputeByoWorker) HasRocm() bool {
if o != nil && !IsNil(o.Rocm) {
return true
}
return false
}
// SetRocm gets a reference to the given string and assigns it to the Rocm field.
func (o *ComputeByoWorker) SetRocm(v string) {
o.Rocm = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *ComputeByoWorker) 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 *ComputeByoWorker) 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 *ComputeByoWorker) 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 *ComputeByoWorker) SetStatus(v string) {
o.Status = &v
}
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *ComputeByoWorker) GetVersion() string {
if o == nil || IsNil(o.Version) {
var ret string
return ret
}
return *o.Version
}
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeByoWorker) GetVersionOk() (*string, bool) {
if o == nil || IsNil(o.Version) {
return nil, false
}
return o.Version, true
}
// HasVersion returns a boolean if a field has been set.
func (o *ComputeByoWorker) HasVersion() bool {
if o != nil && !IsNil(o.Version) {
return true
}
return false
}
// SetVersion gets a reference to the given string and assigns it to the Version field.
func (o *ComputeByoWorker) SetVersion(v string) {
o.Version = &v
}
func (o ComputeByoWorker) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ComputeByoWorker) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Arch) {
toSerialize["arch"] = o.Arch
}
if !IsNil(o.Capabilities) {
toSerialize["capabilities"] = o.Capabilities
}
if !IsNil(o.CpuModel) {
toSerialize["cpuModel"] = o.CpuModel
}
if !IsNil(o.Cpus) {
toSerialize["cpus"] = o.Cpus
}
if !IsNil(o.Cuda) {
toSerialize["cuda"] = o.Cuda
}
if !IsNil(o.Driver) {
toSerialize["driver"] = o.Driver
}
if !IsNil(o.Engine) {
toSerialize["engine"] = o.Engine
}
if !IsNil(o.FirstSeen) {
toSerialize["firstSeen"] = o.FirstSeen
}
if !IsNil(o.Gpus) {
toSerialize["gpus"] = o.Gpus
}
if !IsNil(o.Hip) {
toSerialize["hip"] = o.Hip
}
if !IsNil(o.Hostname) {
toSerialize["hostname"] = o.Hostname
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.JobQueue) {
toSerialize["jobQueue"] = o.JobQueue
}
if !IsNil(o.Lanes) {
toSerialize["lanes"] = o.Lanes
}
if !IsNil(o.LastHeartbeat) {
toSerialize["lastHeartbeat"] = o.LastHeartbeat
}
if !IsNil(o.Location) {
toSerialize["location"] = o.Location
}
if !IsNil(o.Memory) {
toSerialize["memory"] = o.Memory
}
if !IsNil(o.Models) {
toSerialize["models"] = o.Models
}
if !IsNil(o.Os) {
toSerialize["os"] = o.Os
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
if !IsNil(o.Rocm) {
toSerialize["rocm"] = o.Rocm
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Version) {
toSerialize["version"] = o.Version
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ComputeByoWorker) UnmarshalJSON(data []byte) (err error) {
varComputeByoWorker := _ComputeByoWorker{}
err = json.Unmarshal(data, &varComputeByoWorker)
if err != nil {
return err
}
*o = ComputeByoWorker(varComputeByoWorker)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "arch")
delete(additionalProperties, "capabilities")
delete(additionalProperties, "cpuModel")
delete(additionalProperties, "cpus")
delete(additionalProperties, "cuda")
delete(additionalProperties, "driver")
delete(additionalProperties, "engine")
delete(additionalProperties, "firstSeen")
delete(additionalProperties, "gpus")
delete(additionalProperties, "hip")
delete(additionalProperties, "hostname")
delete(additionalProperties, "id")
delete(additionalProperties, "jobQueue")
delete(additionalProperties, "lanes")
delete(additionalProperties, "lastHeartbeat")
delete(additionalProperties, "location")
delete(additionalProperties, "memory")
delete(additionalProperties, "models")
delete(additionalProperties, "os")
delete(additionalProperties, "provider")
delete(additionalProperties, "rocm")
delete(additionalProperties, "status")
delete(additionalProperties, "version")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableComputeByoWorker struct {
value *ComputeByoWorker
isSet bool
}
func (v NullableComputeByoWorker) Get() *ComputeByoWorker {
return v.value
}
func (v *NullableComputeByoWorker) Set(val *ComputeByoWorker) {
v.value = val
v.isSet = true
}
func (v NullableComputeByoWorker) IsSet() bool {
return v.isSet
}
func (v *NullableComputeByoWorker) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableComputeByoWorker(val *ComputeByoWorker) *NullableComputeByoWorker {
return &NullableComputeByoWorker{value: val, isSet: true}
}
func (v NullableComputeByoWorker) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableComputeByoWorker) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}