Files
sdk/model_compute_fleet_spec.go

345 lines
9.3 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 ComputeFleetSpec type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ComputeFleetSpec{}
// ComputeFleetSpec struct for ComputeFleetSpec
type ComputeFleetSpec struct {
// Arch is the CPU architecture, amd64 or arm64, and it is what decides whether a binary built for the fleet will run here. Only the sources that report one carry it (a linked run-target, a BYO worker).
Arch *string `json:"arch,omitempty"`
// CPUs is logical cores on the unit.
Cpus *int64 `json:"cpus,omitempty"`
// GPUModel names the FIRST accelerator (\"NVIDIA GB10\") as the representative of the set; GPUs carries how many. Empty for a cluster, whose cards are counted rather than modelled, and for a unit with none.
GpuModel *string `json:"gpuModel,omitempty"`
// GPUs is how many accelerators the unit has. For a cluster it is the vendor totals summed across every node, so it counts cards, not machines.
Gpus *int64 `json:"gpus,omitempty"`
// Memory is total system RAM in BYTES — not GB, and not what is free right now (fleetMetrics carries that). Absent when the source reports no RAM figure.
Memory *int64 `json:"memory,omitempty"`
// OS is the operating system the unit runs: linux, darwin or windows. Empty when the source does not report one — a cluster row does not.
Os *string `json:"os,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ComputeFleetSpec ComputeFleetSpec
// NewComputeFleetSpec instantiates a new ComputeFleetSpec 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 NewComputeFleetSpec() *ComputeFleetSpec {
this := ComputeFleetSpec{}
return &this
}
// NewComputeFleetSpecWithDefaults instantiates a new ComputeFleetSpec 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 NewComputeFleetSpecWithDefaults() *ComputeFleetSpec {
this := ComputeFleetSpec{}
return &this
}
// GetArch returns the Arch field value if set, zero value otherwise.
func (o *ComputeFleetSpec) 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 *ComputeFleetSpec) 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 *ComputeFleetSpec) 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 *ComputeFleetSpec) SetArch(v string) {
o.Arch = &v
}
// GetCpus returns the Cpus field value if set, zero value otherwise.
func (o *ComputeFleetSpec) 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 *ComputeFleetSpec) 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 *ComputeFleetSpec) 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 *ComputeFleetSpec) SetCpus(v int64) {
o.Cpus = &v
}
// GetGpuModel returns the GpuModel field value if set, zero value otherwise.
func (o *ComputeFleetSpec) GetGpuModel() string {
if o == nil || IsNil(o.GpuModel) {
var ret string
return ret
}
return *o.GpuModel
}
// GetGpuModelOk returns a tuple with the GpuModel field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeFleetSpec) GetGpuModelOk() (*string, bool) {
if o == nil || IsNil(o.GpuModel) {
return nil, false
}
return o.GpuModel, true
}
// HasGpuModel returns a boolean if a field has been set.
func (o *ComputeFleetSpec) HasGpuModel() bool {
if o != nil && !IsNil(o.GpuModel) {
return true
}
return false
}
// SetGpuModel gets a reference to the given string and assigns it to the GpuModel field.
func (o *ComputeFleetSpec) SetGpuModel(v string) {
o.GpuModel = &v
}
// GetGpus returns the Gpus field value if set, zero value otherwise.
func (o *ComputeFleetSpec) GetGpus() int64 {
if o == nil || IsNil(o.Gpus) {
var ret int64
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 *ComputeFleetSpec) GetGpusOk() (*int64, 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 *ComputeFleetSpec) HasGpus() bool {
if o != nil && !IsNil(o.Gpus) {
return true
}
return false
}
// SetGpus gets a reference to the given int64 and assigns it to the Gpus field.
func (o *ComputeFleetSpec) SetGpus(v int64) {
o.Gpus = &v
}
// GetMemory returns the Memory field value if set, zero value otherwise.
func (o *ComputeFleetSpec) 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 *ComputeFleetSpec) 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 *ComputeFleetSpec) 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 *ComputeFleetSpec) SetMemory(v int64) {
o.Memory = &v
}
// GetOs returns the Os field value if set, zero value otherwise.
func (o *ComputeFleetSpec) 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 *ComputeFleetSpec) 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 *ComputeFleetSpec) 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 *ComputeFleetSpec) SetOs(v string) {
o.Os = &v
}
func (o ComputeFleetSpec) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ComputeFleetSpec) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Arch) {
toSerialize["arch"] = o.Arch
}
if !IsNil(o.Cpus) {
toSerialize["cpus"] = o.Cpus
}
if !IsNil(o.GpuModel) {
toSerialize["gpuModel"] = o.GpuModel
}
if !IsNil(o.Gpus) {
toSerialize["gpus"] = o.Gpus
}
if !IsNil(o.Memory) {
toSerialize["memory"] = o.Memory
}
if !IsNil(o.Os) {
toSerialize["os"] = o.Os
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ComputeFleetSpec) UnmarshalJSON(data []byte) (err error) {
varComputeFleetSpec := _ComputeFleetSpec{}
err = json.Unmarshal(data, &varComputeFleetSpec)
if err != nil {
return err
}
*o = ComputeFleetSpec(varComputeFleetSpec)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "arch")
delete(additionalProperties, "cpus")
delete(additionalProperties, "gpuModel")
delete(additionalProperties, "gpus")
delete(additionalProperties, "memory")
delete(additionalProperties, "os")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableComputeFleetSpec struct {
value *ComputeFleetSpec
isSet bool
}
func (v NullableComputeFleetSpec) Get() *ComputeFleetSpec {
return v.value
}
func (v *NullableComputeFleetSpec) Set(val *ComputeFleetSpec) {
v.value = val
v.isSet = true
}
func (v NullableComputeFleetSpec) IsSet() bool {
return v.isSet
}
func (v *NullableComputeFleetSpec) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableComputeFleetSpec(val *ComputeFleetSpec) *NullableComputeFleetSpec {
return &NullableComputeFleetSpec{value: val, isSet: true}
}
func (v NullableComputeFleetSpec) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableComputeFleetSpec) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}