Files
sdk/model_compute_gpu_list.go

155 lines
3.9 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 ComputeGpuList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ComputeGpuList{}
// ComputeGpuList struct for ComputeGpuList
type ComputeGpuList struct {
// GPUs is every accelerator the org has, from Visor GPU droplets and from BYO workers alike.
Gpus []ComputeGpuView `json:"gpus,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ComputeGpuList ComputeGpuList
// NewComputeGpuList instantiates a new ComputeGpuList 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 NewComputeGpuList() *ComputeGpuList {
this := ComputeGpuList{}
return &this
}
// NewComputeGpuListWithDefaults instantiates a new ComputeGpuList 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 NewComputeGpuListWithDefaults() *ComputeGpuList {
this := ComputeGpuList{}
return &this
}
// GetGpus returns the Gpus field value if set, zero value otherwise.
func (o *ComputeGpuList) GetGpus() []ComputeGpuView {
if o == nil || IsNil(o.Gpus) {
var ret []ComputeGpuView
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 *ComputeGpuList) GetGpusOk() ([]ComputeGpuView, 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 *ComputeGpuList) HasGpus() bool {
if o != nil && !IsNil(o.Gpus) {
return true
}
return false
}
// SetGpus gets a reference to the given []ComputeGpuView and assigns it to the Gpus field.
func (o *ComputeGpuList) SetGpus(v []ComputeGpuView) {
o.Gpus = v
}
func (o ComputeGpuList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ComputeGpuList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Gpus) {
toSerialize["gpus"] = o.Gpus
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ComputeGpuList) UnmarshalJSON(data []byte) (err error) {
varComputeGpuList := _ComputeGpuList{}
err = json.Unmarshal(data, &varComputeGpuList)
if err != nil {
return err
}
*o = ComputeGpuList(varComputeGpuList)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "gpus")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableComputeGpuList struct {
value *ComputeGpuList
isSet bool
}
func (v NullableComputeGpuList) Get() *ComputeGpuList {
return v.value
}
func (v *NullableComputeGpuList) Set(val *ComputeGpuList) {
v.value = val
v.isSet = true
}
func (v NullableComputeGpuList) IsSet() bool {
return v.isSet
}
func (v *NullableComputeGpuList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableComputeGpuList(val *ComputeGpuList) *NullableComputeGpuList {
return &NullableComputeGpuList{value: val, isSet: true}
}
func (v NullableComputeGpuList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableComputeGpuList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}