mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
380 lines
9.1 KiB
Go
380 lines
9.1 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 StudioGpu type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &StudioGpu{}
|
|
|
|
// StudioGpu struct for StudioGpu
|
|
type StudioGpu struct {
|
|
Id *string `json:"id,omitempty"`
|
|
Machine *string `json:"machine,omitempty"`
|
|
// Name is the device, as its worker reports it.
|
|
Name *string `json:"name,omitempty"`
|
|
// Owner is org (linked by your org with hanzo link) or platform.
|
|
Owner *string `json:"owner,omitempty"`
|
|
// Seen is its worker's last heartbeat.
|
|
Seen *string `json:"seen,omitempty"`
|
|
// Status is idle, busy or offline.
|
|
Status *string `json:"status,omitempty"`
|
|
VramMb *int64 `json:"vram_mb,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _StudioGpu StudioGpu
|
|
|
|
// NewStudioGpu instantiates a new StudioGpu 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 NewStudioGpu() *StudioGpu {
|
|
this := StudioGpu{}
|
|
return &this
|
|
}
|
|
|
|
// NewStudioGpuWithDefaults instantiates a new StudioGpu 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 NewStudioGpuWithDefaults() *StudioGpu {
|
|
this := StudioGpu{}
|
|
return &this
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *StudioGpu) 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 *StudioGpu) 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 *StudioGpu) 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 *StudioGpu) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetMachine returns the Machine field value if set, zero value otherwise.
|
|
func (o *StudioGpu) 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 *StudioGpu) 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 *StudioGpu) 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 *StudioGpu) SetMachine(v string) {
|
|
o.Machine = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *StudioGpu) 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 *StudioGpu) 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 *StudioGpu) 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 *StudioGpu) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetOwner returns the Owner field value if set, zero value otherwise.
|
|
func (o *StudioGpu) GetOwner() string {
|
|
if o == nil || IsNil(o.Owner) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Owner
|
|
}
|
|
|
|
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *StudioGpu) GetOwnerOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Owner) {
|
|
return nil, false
|
|
}
|
|
return o.Owner, true
|
|
}
|
|
|
|
// HasOwner returns a boolean if a field has been set.
|
|
func (o *StudioGpu) HasOwner() bool {
|
|
if o != nil && !IsNil(o.Owner) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetOwner gets a reference to the given string and assigns it to the Owner field.
|
|
func (o *StudioGpu) SetOwner(v string) {
|
|
o.Owner = &v
|
|
}
|
|
|
|
// GetSeen returns the Seen field value if set, zero value otherwise.
|
|
func (o *StudioGpu) GetSeen() string {
|
|
if o == nil || IsNil(o.Seen) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Seen
|
|
}
|
|
|
|
// GetSeenOk returns a tuple with the Seen field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *StudioGpu) GetSeenOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Seen) {
|
|
return nil, false
|
|
}
|
|
return o.Seen, true
|
|
}
|
|
|
|
// HasSeen returns a boolean if a field has been set.
|
|
func (o *StudioGpu) HasSeen() bool {
|
|
if o != nil && !IsNil(o.Seen) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSeen gets a reference to the given string and assigns it to the Seen field.
|
|
func (o *StudioGpu) SetSeen(v string) {
|
|
o.Seen = &v
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *StudioGpu) 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 *StudioGpu) 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 *StudioGpu) 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 *StudioGpu) SetStatus(v string) {
|
|
o.Status = &v
|
|
}
|
|
|
|
// GetVramMb returns the VramMb field value if set, zero value otherwise.
|
|
func (o *StudioGpu) GetVramMb() int64 {
|
|
if o == nil || IsNil(o.VramMb) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.VramMb
|
|
}
|
|
|
|
// GetVramMbOk returns a tuple with the VramMb field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *StudioGpu) GetVramMbOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.VramMb) {
|
|
return nil, false
|
|
}
|
|
return o.VramMb, true
|
|
}
|
|
|
|
// HasVramMb returns a boolean if a field has been set.
|
|
func (o *StudioGpu) HasVramMb() bool {
|
|
if o != nil && !IsNil(o.VramMb) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetVramMb gets a reference to the given int64 and assigns it to the VramMb field.
|
|
func (o *StudioGpu) SetVramMb(v int64) {
|
|
o.VramMb = &v
|
|
}
|
|
|
|
func (o StudioGpu) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o StudioGpu) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Machine) {
|
|
toSerialize["machine"] = o.Machine
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Owner) {
|
|
toSerialize["owner"] = o.Owner
|
|
}
|
|
if !IsNil(o.Seen) {
|
|
toSerialize["seen"] = o.Seen
|
|
}
|
|
if !IsNil(o.Status) {
|
|
toSerialize["status"] = o.Status
|
|
}
|
|
if !IsNil(o.VramMb) {
|
|
toSerialize["vram_mb"] = o.VramMb
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *StudioGpu) UnmarshalJSON(data []byte) (err error) {
|
|
varStudioGpu := _StudioGpu{}
|
|
|
|
err = json.Unmarshal(data, &varStudioGpu)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = StudioGpu(varStudioGpu)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "machine")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "owner")
|
|
delete(additionalProperties, "seen")
|
|
delete(additionalProperties, "status")
|
|
delete(additionalProperties, "vram_mb")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableStudioGpu struct {
|
|
value *StudioGpu
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableStudioGpu) Get() *StudioGpu {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableStudioGpu) Set(val *StudioGpu) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableStudioGpu) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableStudioGpu) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableStudioGpu(val *StudioGpu) *NullableStudioGpu {
|
|
return &NullableStudioGpu{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableStudioGpu) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableStudioGpu) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|