mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
459 lines
13 KiB
Go
459 lines
13 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 ComputeGpuView type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ComputeGpuView{}
|
|
|
|
// ComputeGpuView struct for ComputeGpuView
|
|
type ComputeGpuView struct {
|
|
// ID is the card's address: its host machine's id, \"#\", and the card's ordinal within that machine (\"gpu-1#0\"). Stable for as long as the machine is, and the only id a single accelerator has — providers do not name cards.
|
|
Id *string `json:"id,omitempty"`
|
|
// Location is where the card physically sits, which for every source today is the same value Region carries — the console renders it in its own column.
|
|
Location *string `json:"location,omitempty"`
|
|
// Machine is the id of the machine holding this card, addressable as-is on /v1/compute/machines/:id.
|
|
Machine *string `json:"machine,omitempty"`
|
|
// Memory is the card's VRAM as its own tooling reported it (\"122880 MiB\") — a display string in the reporter's units, not a byte count. BYO cards carry it (nvidia-smi); Visor's machine object states no VRAM, so a rented card leaves it empty and the console renders \"—\" rather than a fabricated 0.
|
|
Memory *string `json:"memory,omitempty"`
|
|
// Model is the accelerator: the model token read out of the size slug for a Visor GPU droplet (\"H100\", \"MI300X\"), or the name nvidia-smi reported for a BYO card (\"NVIDIA GB10\").
|
|
Model *string `json:"model,omitempty"`
|
|
// Name is the HOST MACHINE's display name, not the card's — every card in a gpu-h100x8 node repeats it. Model is what says which accelerator this is.
|
|
Name *string `json:"name,omitempty"`
|
|
// Provider distinguishes a BYO accelerator (\"byo\") from a Visor-provisioned one (the host machine's real provider). It is what tells a card the org owns from a card the org rents.
|
|
Provider *string `json:"provider,omitempty"`
|
|
// Region is the host machine's provider region slug; \"on-prem\" for a BYO card.
|
|
Region *string `json:"region,omitempty"`
|
|
// Status is the HOST MACHINE's lifecycle state, because nothing upstream reports a card's own health. A card reads running because its machine does.
|
|
Status *string `json:"status,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _ComputeGpuView ComputeGpuView
|
|
|
|
// NewComputeGpuView instantiates a new ComputeGpuView 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 NewComputeGpuView() *ComputeGpuView {
|
|
this := ComputeGpuView{}
|
|
return &this
|
|
}
|
|
|
|
// NewComputeGpuViewWithDefaults instantiates a new ComputeGpuView 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 NewComputeGpuViewWithDefaults() *ComputeGpuView {
|
|
this := ComputeGpuView{}
|
|
return &this
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *ComputeGpuView) 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 *ComputeGpuView) 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 *ComputeGpuView) 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 *ComputeGpuView) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetLocation returns the Location field value if set, zero value otherwise.
|
|
func (o *ComputeGpuView) 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 *ComputeGpuView) 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 *ComputeGpuView) 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 *ComputeGpuView) SetLocation(v string) {
|
|
o.Location = &v
|
|
}
|
|
|
|
// GetMachine returns the Machine field value if set, zero value otherwise.
|
|
func (o *ComputeGpuView) GetMachine() string {
|
|
if o == nil || IsNil(o.Machine) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Machine
|
|
}
|
|
|
|
// GetMachineOk returns a tuple with the Machine field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ComputeGpuView) GetMachineOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Machine) {
|
|
return nil, false
|
|
}
|
|
return o.Machine, true
|
|
}
|
|
|
|
// HasMachine returns a boolean if a field has been set.
|
|
func (o *ComputeGpuView) HasMachine() bool {
|
|
if o != nil && !IsNil(o.Machine) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMachine gets a reference to the given string and assigns it to the Machine field.
|
|
func (o *ComputeGpuView) SetMachine(v string) {
|
|
o.Machine = &v
|
|
}
|
|
|
|
// GetMemory returns the Memory field value if set, zero value otherwise.
|
|
func (o *ComputeGpuView) GetMemory() string {
|
|
if o == nil || IsNil(o.Memory) {
|
|
var ret string
|
|
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 *ComputeGpuView) GetMemoryOk() (*string, 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 *ComputeGpuView) HasMemory() bool {
|
|
if o != nil && !IsNil(o.Memory) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMemory gets a reference to the given string and assigns it to the Memory field.
|
|
func (o *ComputeGpuView) SetMemory(v string) {
|
|
o.Memory = &v
|
|
}
|
|
|
|
// GetModel returns the Model field value if set, zero value otherwise.
|
|
func (o *ComputeGpuView) GetModel() string {
|
|
if o == nil || IsNil(o.Model) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Model
|
|
}
|
|
|
|
// GetModelOk returns a tuple with the Model field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ComputeGpuView) GetModelOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Model) {
|
|
return nil, false
|
|
}
|
|
return o.Model, true
|
|
}
|
|
|
|
// HasModel returns a boolean if a field has been set.
|
|
func (o *ComputeGpuView) HasModel() bool {
|
|
if o != nil && !IsNil(o.Model) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetModel gets a reference to the given string and assigns it to the Model field.
|
|
func (o *ComputeGpuView) SetModel(v string) {
|
|
o.Model = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *ComputeGpuView) 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 *ComputeGpuView) 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 *ComputeGpuView) 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 *ComputeGpuView) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetProvider returns the Provider field value if set, zero value otherwise.
|
|
func (o *ComputeGpuView) 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 *ComputeGpuView) 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 *ComputeGpuView) 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 *ComputeGpuView) SetProvider(v string) {
|
|
o.Provider = &v
|
|
}
|
|
|
|
// GetRegion returns the Region field value if set, zero value otherwise.
|
|
func (o *ComputeGpuView) 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 *ComputeGpuView) 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 *ComputeGpuView) 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 *ComputeGpuView) SetRegion(v string) {
|
|
o.Region = &v
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *ComputeGpuView) 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 *ComputeGpuView) 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 *ComputeGpuView) 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 *ComputeGpuView) SetStatus(v string) {
|
|
o.Status = &v
|
|
}
|
|
|
|
func (o ComputeGpuView) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ComputeGpuView) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Location) {
|
|
toSerialize["location"] = o.Location
|
|
}
|
|
if !IsNil(o.Machine) {
|
|
toSerialize["machine"] = o.Machine
|
|
}
|
|
if !IsNil(o.Memory) {
|
|
toSerialize["memory"] = o.Memory
|
|
}
|
|
if !IsNil(o.Model) {
|
|
toSerialize["model"] = o.Model
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Provider) {
|
|
toSerialize["provider"] = o.Provider
|
|
}
|
|
if !IsNil(o.Region) {
|
|
toSerialize["region"] = o.Region
|
|
}
|
|
if !IsNil(o.Status) {
|
|
toSerialize["status"] = o.Status
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ComputeGpuView) UnmarshalJSON(data []byte) (err error) {
|
|
varComputeGpuView := _ComputeGpuView{}
|
|
|
|
err = json.Unmarshal(data, &varComputeGpuView)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ComputeGpuView(varComputeGpuView)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "location")
|
|
delete(additionalProperties, "machine")
|
|
delete(additionalProperties, "memory")
|
|
delete(additionalProperties, "model")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "provider")
|
|
delete(additionalProperties, "region")
|
|
delete(additionalProperties, "status")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableComputeGpuView struct {
|
|
value *ComputeGpuView
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableComputeGpuView) Get() *ComputeGpuView {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableComputeGpuView) Set(val *ComputeGpuView) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableComputeGpuView) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableComputeGpuView) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableComputeGpuView(val *ComputeGpuView) *NullableComputeGpuView {
|
|
return &NullableComputeGpuView{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableComputeGpuView) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableComputeGpuView) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|