Files
sdk/model_o11y_node_record.go

451 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 O11yNodeRecord type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &O11yNodeRecord{}
// O11yNodeRecord struct for O11yNodeRecord
type O11yNodeRecord struct {
Condition interface{} `json:"condition,omitempty"`
Meta map[string]string `json:"meta,omitempty"`
NodeCPU *float64 `json:"nodeCPU,omitempty"`
NodeCPUAllocatable *float64 `json:"nodeCPUAllocatable,omitempty"`
NodeCountsByReadiness *O11yNodeCountsByReadiness `json:"nodeCountsByReadiness,omitempty"`
NodeMemory *float64 `json:"nodeMemory,omitempty"`
NodeMemoryAllocatable *float64 `json:"nodeMemoryAllocatable,omitempty"`
NodeName *string `json:"nodeName,omitempty"`
PodCountsByPhase *O11yPodCountsByPhase `json:"podCountsByPhase,omitempty"`
AdditionalProperties map[string]interface{}
}
type _O11yNodeRecord O11yNodeRecord
// NewO11yNodeRecord instantiates a new O11yNodeRecord 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 NewO11yNodeRecord() *O11yNodeRecord {
this := O11yNodeRecord{}
return &this
}
// NewO11yNodeRecordWithDefaults instantiates a new O11yNodeRecord 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 NewO11yNodeRecordWithDefaults() *O11yNodeRecord {
this := O11yNodeRecord{}
return &this
}
// GetCondition returns the Condition field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *O11yNodeRecord) GetCondition() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Condition
}
// GetConditionOk returns a tuple with the Condition field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *O11yNodeRecord) GetConditionOk() (*interface{}, bool) {
if o == nil || IsNil(o.Condition) {
return nil, false
}
return &o.Condition, true
}
// HasCondition returns a boolean if a field has been set.
func (o *O11yNodeRecord) HasCondition() bool {
if o != nil && !IsNil(o.Condition) {
return true
}
return false
}
// SetCondition gets a reference to the given interface{} and assigns it to the Condition field.
func (o *O11yNodeRecord) SetCondition(v interface{}) {
o.Condition = v
}
// GetMeta returns the Meta field value if set, zero value otherwise.
func (o *O11yNodeRecord) GetMeta() map[string]string {
if o == nil || IsNil(o.Meta) {
var ret map[string]string
return ret
}
return o.Meta
}
// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yNodeRecord) GetMetaOk() (map[string]string, bool) {
if o == nil || IsNil(o.Meta) {
return map[string]string{}, false
}
return o.Meta, true
}
// HasMeta returns a boolean if a field has been set.
func (o *O11yNodeRecord) HasMeta() bool {
if o != nil && !IsNil(o.Meta) {
return true
}
return false
}
// SetMeta gets a reference to the given map[string]string and assigns it to the Meta field.
func (o *O11yNodeRecord) SetMeta(v map[string]string) {
o.Meta = v
}
// GetNodeCPU returns the NodeCPU field value if set, zero value otherwise.
func (o *O11yNodeRecord) GetNodeCPU() float64 {
if o == nil || IsNil(o.NodeCPU) {
var ret float64
return ret
}
return *o.NodeCPU
}
// GetNodeCPUOk returns a tuple with the NodeCPU field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yNodeRecord) GetNodeCPUOk() (*float64, bool) {
if o == nil || IsNil(o.NodeCPU) {
return nil, false
}
return o.NodeCPU, true
}
// HasNodeCPU returns a boolean if a field has been set.
func (o *O11yNodeRecord) HasNodeCPU() bool {
if o != nil && !IsNil(o.NodeCPU) {
return true
}
return false
}
// SetNodeCPU gets a reference to the given float64 and assigns it to the NodeCPU field.
func (o *O11yNodeRecord) SetNodeCPU(v float64) {
o.NodeCPU = &v
}
// GetNodeCPUAllocatable returns the NodeCPUAllocatable field value if set, zero value otherwise.
func (o *O11yNodeRecord) GetNodeCPUAllocatable() float64 {
if o == nil || IsNil(o.NodeCPUAllocatable) {
var ret float64
return ret
}
return *o.NodeCPUAllocatable
}
// GetNodeCPUAllocatableOk returns a tuple with the NodeCPUAllocatable field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yNodeRecord) GetNodeCPUAllocatableOk() (*float64, bool) {
if o == nil || IsNil(o.NodeCPUAllocatable) {
return nil, false
}
return o.NodeCPUAllocatable, true
}
// HasNodeCPUAllocatable returns a boolean if a field has been set.
func (o *O11yNodeRecord) HasNodeCPUAllocatable() bool {
if o != nil && !IsNil(o.NodeCPUAllocatable) {
return true
}
return false
}
// SetNodeCPUAllocatable gets a reference to the given float64 and assigns it to the NodeCPUAllocatable field.
func (o *O11yNodeRecord) SetNodeCPUAllocatable(v float64) {
o.NodeCPUAllocatable = &v
}
// GetNodeCountsByReadiness returns the NodeCountsByReadiness field value if set, zero value otherwise.
func (o *O11yNodeRecord) GetNodeCountsByReadiness() O11yNodeCountsByReadiness {
if o == nil || IsNil(o.NodeCountsByReadiness) {
var ret O11yNodeCountsByReadiness
return ret
}
return *o.NodeCountsByReadiness
}
// GetNodeCountsByReadinessOk returns a tuple with the NodeCountsByReadiness field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yNodeRecord) GetNodeCountsByReadinessOk() (*O11yNodeCountsByReadiness, bool) {
if o == nil || IsNil(o.NodeCountsByReadiness) {
return nil, false
}
return o.NodeCountsByReadiness, true
}
// HasNodeCountsByReadiness returns a boolean if a field has been set.
func (o *O11yNodeRecord) HasNodeCountsByReadiness() bool {
if o != nil && !IsNil(o.NodeCountsByReadiness) {
return true
}
return false
}
// SetNodeCountsByReadiness gets a reference to the given O11yNodeCountsByReadiness and assigns it to the NodeCountsByReadiness field.
func (o *O11yNodeRecord) SetNodeCountsByReadiness(v O11yNodeCountsByReadiness) {
o.NodeCountsByReadiness = &v
}
// GetNodeMemory returns the NodeMemory field value if set, zero value otherwise.
func (o *O11yNodeRecord) GetNodeMemory() float64 {
if o == nil || IsNil(o.NodeMemory) {
var ret float64
return ret
}
return *o.NodeMemory
}
// GetNodeMemoryOk returns a tuple with the NodeMemory field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yNodeRecord) GetNodeMemoryOk() (*float64, bool) {
if o == nil || IsNil(o.NodeMemory) {
return nil, false
}
return o.NodeMemory, true
}
// HasNodeMemory returns a boolean if a field has been set.
func (o *O11yNodeRecord) HasNodeMemory() bool {
if o != nil && !IsNil(o.NodeMemory) {
return true
}
return false
}
// SetNodeMemory gets a reference to the given float64 and assigns it to the NodeMemory field.
func (o *O11yNodeRecord) SetNodeMemory(v float64) {
o.NodeMemory = &v
}
// GetNodeMemoryAllocatable returns the NodeMemoryAllocatable field value if set, zero value otherwise.
func (o *O11yNodeRecord) GetNodeMemoryAllocatable() float64 {
if o == nil || IsNil(o.NodeMemoryAllocatable) {
var ret float64
return ret
}
return *o.NodeMemoryAllocatable
}
// GetNodeMemoryAllocatableOk returns a tuple with the NodeMemoryAllocatable field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yNodeRecord) GetNodeMemoryAllocatableOk() (*float64, bool) {
if o == nil || IsNil(o.NodeMemoryAllocatable) {
return nil, false
}
return o.NodeMemoryAllocatable, true
}
// HasNodeMemoryAllocatable returns a boolean if a field has been set.
func (o *O11yNodeRecord) HasNodeMemoryAllocatable() bool {
if o != nil && !IsNil(o.NodeMemoryAllocatable) {
return true
}
return false
}
// SetNodeMemoryAllocatable gets a reference to the given float64 and assigns it to the NodeMemoryAllocatable field.
func (o *O11yNodeRecord) SetNodeMemoryAllocatable(v float64) {
o.NodeMemoryAllocatable = &v
}
// GetNodeName returns the NodeName field value if set, zero value otherwise.
func (o *O11yNodeRecord) GetNodeName() string {
if o == nil || IsNil(o.NodeName) {
var ret string
return ret
}
return *o.NodeName
}
// GetNodeNameOk returns a tuple with the NodeName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yNodeRecord) GetNodeNameOk() (*string, bool) {
if o == nil || IsNil(o.NodeName) {
return nil, false
}
return o.NodeName, true
}
// HasNodeName returns a boolean if a field has been set.
func (o *O11yNodeRecord) HasNodeName() bool {
if o != nil && !IsNil(o.NodeName) {
return true
}
return false
}
// SetNodeName gets a reference to the given string and assigns it to the NodeName field.
func (o *O11yNodeRecord) SetNodeName(v string) {
o.NodeName = &v
}
// GetPodCountsByPhase returns the PodCountsByPhase field value if set, zero value otherwise.
func (o *O11yNodeRecord) GetPodCountsByPhase() O11yPodCountsByPhase {
if o == nil || IsNil(o.PodCountsByPhase) {
var ret O11yPodCountsByPhase
return ret
}
return *o.PodCountsByPhase
}
// GetPodCountsByPhaseOk returns a tuple with the PodCountsByPhase field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yNodeRecord) GetPodCountsByPhaseOk() (*O11yPodCountsByPhase, bool) {
if o == nil || IsNil(o.PodCountsByPhase) {
return nil, false
}
return o.PodCountsByPhase, true
}
// HasPodCountsByPhase returns a boolean if a field has been set.
func (o *O11yNodeRecord) HasPodCountsByPhase() bool {
if o != nil && !IsNil(o.PodCountsByPhase) {
return true
}
return false
}
// SetPodCountsByPhase gets a reference to the given O11yPodCountsByPhase and assigns it to the PodCountsByPhase field.
func (o *O11yNodeRecord) SetPodCountsByPhase(v O11yPodCountsByPhase) {
o.PodCountsByPhase = &v
}
func (o O11yNodeRecord) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o O11yNodeRecord) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Condition != nil {
toSerialize["condition"] = o.Condition
}
if !IsNil(o.Meta) {
toSerialize["meta"] = o.Meta
}
if !IsNil(o.NodeCPU) {
toSerialize["nodeCPU"] = o.NodeCPU
}
if !IsNil(o.NodeCPUAllocatable) {
toSerialize["nodeCPUAllocatable"] = o.NodeCPUAllocatable
}
if !IsNil(o.NodeCountsByReadiness) {
toSerialize["nodeCountsByReadiness"] = o.NodeCountsByReadiness
}
if !IsNil(o.NodeMemory) {
toSerialize["nodeMemory"] = o.NodeMemory
}
if !IsNil(o.NodeMemoryAllocatable) {
toSerialize["nodeMemoryAllocatable"] = o.NodeMemoryAllocatable
}
if !IsNil(o.NodeName) {
toSerialize["nodeName"] = o.NodeName
}
if !IsNil(o.PodCountsByPhase) {
toSerialize["podCountsByPhase"] = o.PodCountsByPhase
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *O11yNodeRecord) UnmarshalJSON(data []byte) (err error) {
varO11yNodeRecord := _O11yNodeRecord{}
err = json.Unmarshal(data, &varO11yNodeRecord)
if err != nil {
return err
}
*o = O11yNodeRecord(varO11yNodeRecord)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "condition")
delete(additionalProperties, "meta")
delete(additionalProperties, "nodeCPU")
delete(additionalProperties, "nodeCPUAllocatable")
delete(additionalProperties, "nodeCountsByReadiness")
delete(additionalProperties, "nodeMemory")
delete(additionalProperties, "nodeMemoryAllocatable")
delete(additionalProperties, "nodeName")
delete(additionalProperties, "podCountsByPhase")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableO11yNodeRecord struct {
value *O11yNodeRecord
isSet bool
}
func (v NullableO11yNodeRecord) Get() *O11yNodeRecord {
return v.value
}
func (v *NullableO11yNodeRecord) Set(val *O11yNodeRecord) {
v.value = val
v.isSet = true
}
func (v NullableO11yNodeRecord) IsSet() bool {
return v.isSet
}
func (v *NullableO11yNodeRecord) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableO11yNodeRecord(val *O11yNodeRecord) *NullableO11yNodeRecord {
return &NullableO11yNodeRecord{value: val, isSet: true}
}
func (v NullableO11yNodeRecord) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableO11yNodeRecord) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}