Files
sdk/model_compute_sample_ingest.go

383 lines
10 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 ComputeSampleIngest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ComputeSampleIngest{}
// ComputeSampleIngest struct for ComputeSampleIngest
type ComputeSampleIngest struct {
// GPUModel names the representative accelerator (\"GB10\"); GPUs carries how many. A heterogeneous host names its first card rather than inventing a summary.
GpuModel *string `json:"gpuModel,omitempty"`
// GPUUtil is accelerator utilization as a fraction 0..1; the warehouse clamps anything outside that.
GpuUtil *float64 `json:"gpuUtil,omitempty"`
// GPUs is how many accelerators this reading covers.
Gpus *int64 `json:"gpus,omitempty"`
// Host is the node's hostname, for display.
Host *string `json:"host,omitempty"`
// MemFree is host memory still available, in BYTES.
MemFree *int64 `json:"memFree,omitempty"`
// MemUsed is host memory in use, in BYTES.
MemUsed *int64 `json:"memUsed,omitempty"`
// Unit is the reporting node's own id — the same id it registered under, and the key the board joins this series onto. Required.
Unit *string `json:"unit,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ComputeSampleIngest ComputeSampleIngest
// NewComputeSampleIngest instantiates a new ComputeSampleIngest 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 NewComputeSampleIngest() *ComputeSampleIngest {
this := ComputeSampleIngest{}
return &this
}
// NewComputeSampleIngestWithDefaults instantiates a new ComputeSampleIngest 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 NewComputeSampleIngestWithDefaults() *ComputeSampleIngest {
this := ComputeSampleIngest{}
return &this
}
// GetGpuModel returns the GpuModel field value if set, zero value otherwise.
func (o *ComputeSampleIngest) 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 *ComputeSampleIngest) 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 *ComputeSampleIngest) 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 *ComputeSampleIngest) SetGpuModel(v string) {
o.GpuModel = &v
}
// GetGpuUtil returns the GpuUtil field value if set, zero value otherwise.
func (o *ComputeSampleIngest) GetGpuUtil() float64 {
if o == nil || IsNil(o.GpuUtil) {
var ret float64
return ret
}
return *o.GpuUtil
}
// GetGpuUtilOk returns a tuple with the GpuUtil field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeSampleIngest) GetGpuUtilOk() (*float64, bool) {
if o == nil || IsNil(o.GpuUtil) {
return nil, false
}
return o.GpuUtil, true
}
// HasGpuUtil returns a boolean if a field has been set.
func (o *ComputeSampleIngest) HasGpuUtil() bool {
if o != nil && !IsNil(o.GpuUtil) {
return true
}
return false
}
// SetGpuUtil gets a reference to the given float64 and assigns it to the GpuUtil field.
func (o *ComputeSampleIngest) SetGpuUtil(v float64) {
o.GpuUtil = &v
}
// GetGpus returns the Gpus field value if set, zero value otherwise.
func (o *ComputeSampleIngest) 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 *ComputeSampleIngest) 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 *ComputeSampleIngest) 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 *ComputeSampleIngest) SetGpus(v int64) {
o.Gpus = &v
}
// GetHost returns the Host field value if set, zero value otherwise.
func (o *ComputeSampleIngest) GetHost() string {
if o == nil || IsNil(o.Host) {
var ret string
return ret
}
return *o.Host
}
// GetHostOk returns a tuple with the Host field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeSampleIngest) GetHostOk() (*string, bool) {
if o == nil || IsNil(o.Host) {
return nil, false
}
return o.Host, true
}
// HasHost returns a boolean if a field has been set.
func (o *ComputeSampleIngest) HasHost() bool {
if o != nil && !IsNil(o.Host) {
return true
}
return false
}
// SetHost gets a reference to the given string and assigns it to the Host field.
func (o *ComputeSampleIngest) SetHost(v string) {
o.Host = &v
}
// GetMemFree returns the MemFree field value if set, zero value otherwise.
func (o *ComputeSampleIngest) GetMemFree() int64 {
if o == nil || IsNil(o.MemFree) {
var ret int64
return ret
}
return *o.MemFree
}
// GetMemFreeOk returns a tuple with the MemFree field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeSampleIngest) GetMemFreeOk() (*int64, bool) {
if o == nil || IsNil(o.MemFree) {
return nil, false
}
return o.MemFree, true
}
// HasMemFree returns a boolean if a field has been set.
func (o *ComputeSampleIngest) HasMemFree() bool {
if o != nil && !IsNil(o.MemFree) {
return true
}
return false
}
// SetMemFree gets a reference to the given int64 and assigns it to the MemFree field.
func (o *ComputeSampleIngest) SetMemFree(v int64) {
o.MemFree = &v
}
// GetMemUsed returns the MemUsed field value if set, zero value otherwise.
func (o *ComputeSampleIngest) GetMemUsed() int64 {
if o == nil || IsNil(o.MemUsed) {
var ret int64
return ret
}
return *o.MemUsed
}
// GetMemUsedOk returns a tuple with the MemUsed field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeSampleIngest) GetMemUsedOk() (*int64, bool) {
if o == nil || IsNil(o.MemUsed) {
return nil, false
}
return o.MemUsed, true
}
// HasMemUsed returns a boolean if a field has been set.
func (o *ComputeSampleIngest) HasMemUsed() bool {
if o != nil && !IsNil(o.MemUsed) {
return true
}
return false
}
// SetMemUsed gets a reference to the given int64 and assigns it to the MemUsed field.
func (o *ComputeSampleIngest) SetMemUsed(v int64) {
o.MemUsed = &v
}
// GetUnit returns the Unit field value if set, zero value otherwise.
func (o *ComputeSampleIngest) GetUnit() string {
if o == nil || IsNil(o.Unit) {
var ret string
return ret
}
return *o.Unit
}
// GetUnitOk returns a tuple with the Unit field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeSampleIngest) GetUnitOk() (*string, bool) {
if o == nil || IsNil(o.Unit) {
return nil, false
}
return o.Unit, true
}
// HasUnit returns a boolean if a field has been set.
func (o *ComputeSampleIngest) HasUnit() bool {
if o != nil && !IsNil(o.Unit) {
return true
}
return false
}
// SetUnit gets a reference to the given string and assigns it to the Unit field.
func (o *ComputeSampleIngest) SetUnit(v string) {
o.Unit = &v
}
func (o ComputeSampleIngest) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ComputeSampleIngest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.GpuModel) {
toSerialize["gpuModel"] = o.GpuModel
}
if !IsNil(o.GpuUtil) {
toSerialize["gpuUtil"] = o.GpuUtil
}
if !IsNil(o.Gpus) {
toSerialize["gpus"] = o.Gpus
}
if !IsNil(o.Host) {
toSerialize["host"] = o.Host
}
if !IsNil(o.MemFree) {
toSerialize["memFree"] = o.MemFree
}
if !IsNil(o.MemUsed) {
toSerialize["memUsed"] = o.MemUsed
}
if !IsNil(o.Unit) {
toSerialize["unit"] = o.Unit
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ComputeSampleIngest) UnmarshalJSON(data []byte) (err error) {
varComputeSampleIngest := _ComputeSampleIngest{}
err = json.Unmarshal(data, &varComputeSampleIngest)
if err != nil {
return err
}
*o = ComputeSampleIngest(varComputeSampleIngest)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "gpuModel")
delete(additionalProperties, "gpuUtil")
delete(additionalProperties, "gpus")
delete(additionalProperties, "host")
delete(additionalProperties, "memFree")
delete(additionalProperties, "memUsed")
delete(additionalProperties, "unit")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableComputeSampleIngest struct {
value *ComputeSampleIngest
isSet bool
}
func (v NullableComputeSampleIngest) Get() *ComputeSampleIngest {
return v.value
}
func (v *NullableComputeSampleIngest) Set(val *ComputeSampleIngest) {
v.value = val
v.isSet = true
}
func (v NullableComputeSampleIngest) IsSet() bool {
return v.isSet
}
func (v *NullableComputeSampleIngest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableComputeSampleIngest(val *ComputeSampleIngest) *NullableComputeSampleIngest {
return &NullableComputeSampleIngest{value: val, isSet: true}
}
func (v NullableComputeSampleIngest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableComputeSampleIngest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}