Files
sdk/model_compute_cluster_list.go

193 lines
5.5 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 ComputeClusterList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ComputeClusterList{}
// ComputeClusterList struct for ComputeClusterList
type ComputeClusterList struct {
// Clusters is the merged fleet — kind \"managed\" for Visor-provisioned, \"byo\" for an attached kubeconfig.
Clusters []ComputeClusterView `json:"clusters,omitempty"`
// Degraded names any source that did not answer, so an empty Clusters means \"you have none\" only when this is absent. Omitted when everything answered, so a healthy response is unchanged. See degraded.go.
Degraded []ComputeSourceFailure `json:"degraded,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ComputeClusterList ComputeClusterList
// NewComputeClusterList instantiates a new ComputeClusterList 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 NewComputeClusterList() *ComputeClusterList {
this := ComputeClusterList{}
return &this
}
// NewComputeClusterListWithDefaults instantiates a new ComputeClusterList 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 NewComputeClusterListWithDefaults() *ComputeClusterList {
this := ComputeClusterList{}
return &this
}
// GetClusters returns the Clusters field value if set, zero value otherwise.
func (o *ComputeClusterList) GetClusters() []ComputeClusterView {
if o == nil || IsNil(o.Clusters) {
var ret []ComputeClusterView
return ret
}
return o.Clusters
}
// GetClustersOk returns a tuple with the Clusters field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeClusterList) GetClustersOk() ([]ComputeClusterView, bool) {
if o == nil || IsNil(o.Clusters) {
return nil, false
}
return o.Clusters, true
}
// HasClusters returns a boolean if a field has been set.
func (o *ComputeClusterList) HasClusters() bool {
if o != nil && !IsNil(o.Clusters) {
return true
}
return false
}
// SetClusters gets a reference to the given []ComputeClusterView and assigns it to the Clusters field.
func (o *ComputeClusterList) SetClusters(v []ComputeClusterView) {
o.Clusters = v
}
// GetDegraded returns the Degraded field value if set, zero value otherwise.
func (o *ComputeClusterList) GetDegraded() []ComputeSourceFailure {
if o == nil || IsNil(o.Degraded) {
var ret []ComputeSourceFailure
return ret
}
return o.Degraded
}
// GetDegradedOk returns a tuple with the Degraded field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeClusterList) GetDegradedOk() ([]ComputeSourceFailure, bool) {
if o == nil || IsNil(o.Degraded) {
return nil, false
}
return o.Degraded, true
}
// HasDegraded returns a boolean if a field has been set.
func (o *ComputeClusterList) HasDegraded() bool {
if o != nil && !IsNil(o.Degraded) {
return true
}
return false
}
// SetDegraded gets a reference to the given []ComputeSourceFailure and assigns it to the Degraded field.
func (o *ComputeClusterList) SetDegraded(v []ComputeSourceFailure) {
o.Degraded = v
}
func (o ComputeClusterList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ComputeClusterList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Clusters) {
toSerialize["clusters"] = o.Clusters
}
if !IsNil(o.Degraded) {
toSerialize["degraded"] = o.Degraded
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ComputeClusterList) UnmarshalJSON(data []byte) (err error) {
varComputeClusterList := _ComputeClusterList{}
err = json.Unmarshal(data, &varComputeClusterList)
if err != nil {
return err
}
*o = ComputeClusterList(varComputeClusterList)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "clusters")
delete(additionalProperties, "degraded")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableComputeClusterList struct {
value *ComputeClusterList
isSet bool
}
func (v NullableComputeClusterList) Get() *ComputeClusterList {
return v.value
}
func (v *NullableComputeClusterList) Set(val *ComputeClusterList) {
v.value = val
v.isSet = true
}
func (v NullableComputeClusterList) IsSet() bool {
return v.isSet
}
func (v *NullableComputeClusterList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableComputeClusterList(val *ComputeClusterList) *NullableComputeClusterList {
return &NullableComputeClusterList{value: val, isSet: true}
}
func (v NullableComputeClusterList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableComputeClusterList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}