Files
sdk/model_compute_node_list.go

155 lines
4.0 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 ComputeNodeList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ComputeNodeList{}
// ComputeNodeList struct for ComputeNodeList
type ComputeNodeList struct {
// Nodes is one row per worker node, in the SAME machineView shape the machines surface emits — a node IS a machine.
Nodes []ComputeMachineView `json:"nodes,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ComputeNodeList ComputeNodeList
// NewComputeNodeList instantiates a new ComputeNodeList 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 NewComputeNodeList() *ComputeNodeList {
this := ComputeNodeList{}
return &this
}
// NewComputeNodeListWithDefaults instantiates a new ComputeNodeList 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 NewComputeNodeListWithDefaults() *ComputeNodeList {
this := ComputeNodeList{}
return &this
}
// GetNodes returns the Nodes field value if set, zero value otherwise.
func (o *ComputeNodeList) GetNodes() []ComputeMachineView {
if o == nil || IsNil(o.Nodes) {
var ret []ComputeMachineView
return ret
}
return o.Nodes
}
// GetNodesOk returns a tuple with the Nodes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeNodeList) GetNodesOk() ([]ComputeMachineView, bool) {
if o == nil || IsNil(o.Nodes) {
return nil, false
}
return o.Nodes, true
}
// HasNodes returns a boolean if a field has been set.
func (o *ComputeNodeList) HasNodes() bool {
if o != nil && !IsNil(o.Nodes) {
return true
}
return false
}
// SetNodes gets a reference to the given []ComputeMachineView and assigns it to the Nodes field.
func (o *ComputeNodeList) SetNodes(v []ComputeMachineView) {
o.Nodes = v
}
func (o ComputeNodeList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ComputeNodeList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Nodes) {
toSerialize["nodes"] = o.Nodes
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ComputeNodeList) UnmarshalJSON(data []byte) (err error) {
varComputeNodeList := _ComputeNodeList{}
err = json.Unmarshal(data, &varComputeNodeList)
if err != nil {
return err
}
*o = ComputeNodeList(varComputeNodeList)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "nodes")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableComputeNodeList struct {
value *ComputeNodeList
isSet bool
}
func (v NullableComputeNodeList) Get() *ComputeNodeList {
return v.value
}
func (v *NullableComputeNodeList) Set(val *ComputeNodeList) {
v.value = val
v.isSet = true
}
func (v NullableComputeNodeList) IsSet() bool {
return v.isSet
}
func (v *NullableComputeNodeList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableComputeNodeList(val *ComputeNodeList) *NullableComputeNodeList {
return &NullableComputeNodeList{value: val, isSet: true}
}
func (v NullableComputeNodeList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableComputeNodeList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}