Files
sdk/model_o11y_host_record.go

488 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 O11yHostRecord type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &O11yHostRecord{}
// O11yHostRecord struct for O11yHostRecord
type O11yHostRecord struct {
ActiveHostCount *int64 `json:"activeHostCount,omitempty"`
Cpu *float64 `json:"cpu,omitempty"`
DiskUsage *float64 `json:"diskUsage,omitempty"`
HostName *string `json:"hostName,omitempty"`
InactiveHostCount *int64 `json:"inactiveHostCount,omitempty"`
Load15 *float64 `json:"load15,omitempty"`
Memory *float64 `json:"memory,omitempty"`
Meta map[string]string `json:"meta,omitempty"`
Status interface{} `json:"status,omitempty"`
Wait *float64 `json:"wait,omitempty"`
AdditionalProperties map[string]interface{}
}
type _O11yHostRecord O11yHostRecord
// NewO11yHostRecord instantiates a new O11yHostRecord 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 NewO11yHostRecord() *O11yHostRecord {
this := O11yHostRecord{}
return &this
}
// NewO11yHostRecordWithDefaults instantiates a new O11yHostRecord 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 NewO11yHostRecordWithDefaults() *O11yHostRecord {
this := O11yHostRecord{}
return &this
}
// GetActiveHostCount returns the ActiveHostCount field value if set, zero value otherwise.
func (o *O11yHostRecord) GetActiveHostCount() int64 {
if o == nil || IsNil(o.ActiveHostCount) {
var ret int64
return ret
}
return *o.ActiveHostCount
}
// GetActiveHostCountOk returns a tuple with the ActiveHostCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yHostRecord) GetActiveHostCountOk() (*int64, bool) {
if o == nil || IsNil(o.ActiveHostCount) {
return nil, false
}
return o.ActiveHostCount, true
}
// HasActiveHostCount returns a boolean if a field has been set.
func (o *O11yHostRecord) HasActiveHostCount() bool {
if o != nil && !IsNil(o.ActiveHostCount) {
return true
}
return false
}
// SetActiveHostCount gets a reference to the given int64 and assigns it to the ActiveHostCount field.
func (o *O11yHostRecord) SetActiveHostCount(v int64) {
o.ActiveHostCount = &v
}
// GetCpu returns the Cpu field value if set, zero value otherwise.
func (o *O11yHostRecord) GetCpu() float64 {
if o == nil || IsNil(o.Cpu) {
var ret float64
return ret
}
return *o.Cpu
}
// GetCpuOk returns a tuple with the Cpu field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yHostRecord) GetCpuOk() (*float64, bool) {
if o == nil || IsNil(o.Cpu) {
return nil, false
}
return o.Cpu, true
}
// HasCpu returns a boolean if a field has been set.
func (o *O11yHostRecord) HasCpu() bool {
if o != nil && !IsNil(o.Cpu) {
return true
}
return false
}
// SetCpu gets a reference to the given float64 and assigns it to the Cpu field.
func (o *O11yHostRecord) SetCpu(v float64) {
o.Cpu = &v
}
// GetDiskUsage returns the DiskUsage field value if set, zero value otherwise.
func (o *O11yHostRecord) GetDiskUsage() float64 {
if o == nil || IsNil(o.DiskUsage) {
var ret float64
return ret
}
return *o.DiskUsage
}
// GetDiskUsageOk returns a tuple with the DiskUsage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yHostRecord) GetDiskUsageOk() (*float64, bool) {
if o == nil || IsNil(o.DiskUsage) {
return nil, false
}
return o.DiskUsage, true
}
// HasDiskUsage returns a boolean if a field has been set.
func (o *O11yHostRecord) HasDiskUsage() bool {
if o != nil && !IsNil(o.DiskUsage) {
return true
}
return false
}
// SetDiskUsage gets a reference to the given float64 and assigns it to the DiskUsage field.
func (o *O11yHostRecord) SetDiskUsage(v float64) {
o.DiskUsage = &v
}
// GetHostName returns the HostName field value if set, zero value otherwise.
func (o *O11yHostRecord) GetHostName() string {
if o == nil || IsNil(o.HostName) {
var ret string
return ret
}
return *o.HostName
}
// GetHostNameOk returns a tuple with the HostName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yHostRecord) GetHostNameOk() (*string, bool) {
if o == nil || IsNil(o.HostName) {
return nil, false
}
return o.HostName, true
}
// HasHostName returns a boolean if a field has been set.
func (o *O11yHostRecord) HasHostName() bool {
if o != nil && !IsNil(o.HostName) {
return true
}
return false
}
// SetHostName gets a reference to the given string and assigns it to the HostName field.
func (o *O11yHostRecord) SetHostName(v string) {
o.HostName = &v
}
// GetInactiveHostCount returns the InactiveHostCount field value if set, zero value otherwise.
func (o *O11yHostRecord) GetInactiveHostCount() int64 {
if o == nil || IsNil(o.InactiveHostCount) {
var ret int64
return ret
}
return *o.InactiveHostCount
}
// GetInactiveHostCountOk returns a tuple with the InactiveHostCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yHostRecord) GetInactiveHostCountOk() (*int64, bool) {
if o == nil || IsNil(o.InactiveHostCount) {
return nil, false
}
return o.InactiveHostCount, true
}
// HasInactiveHostCount returns a boolean if a field has been set.
func (o *O11yHostRecord) HasInactiveHostCount() bool {
if o != nil && !IsNil(o.InactiveHostCount) {
return true
}
return false
}
// SetInactiveHostCount gets a reference to the given int64 and assigns it to the InactiveHostCount field.
func (o *O11yHostRecord) SetInactiveHostCount(v int64) {
o.InactiveHostCount = &v
}
// GetLoad15 returns the Load15 field value if set, zero value otherwise.
func (o *O11yHostRecord) GetLoad15() float64 {
if o == nil || IsNil(o.Load15) {
var ret float64
return ret
}
return *o.Load15
}
// GetLoad15Ok returns a tuple with the Load15 field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yHostRecord) GetLoad15Ok() (*float64, bool) {
if o == nil || IsNil(o.Load15) {
return nil, false
}
return o.Load15, true
}
// HasLoad15 returns a boolean if a field has been set.
func (o *O11yHostRecord) HasLoad15() bool {
if o != nil && !IsNil(o.Load15) {
return true
}
return false
}
// SetLoad15 gets a reference to the given float64 and assigns it to the Load15 field.
func (o *O11yHostRecord) SetLoad15(v float64) {
o.Load15 = &v
}
// GetMemory returns the Memory field value if set, zero value otherwise.
func (o *O11yHostRecord) GetMemory() float64 {
if o == nil || IsNil(o.Memory) {
var ret float64
return ret
}
return *o.Memory
}
// GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yHostRecord) GetMemoryOk() (*float64, bool) {
if o == nil || IsNil(o.Memory) {
return nil, false
}
return o.Memory, true
}
// HasMemory returns a boolean if a field has been set.
func (o *O11yHostRecord) HasMemory() bool {
if o != nil && !IsNil(o.Memory) {
return true
}
return false
}
// SetMemory gets a reference to the given float64 and assigns it to the Memory field.
func (o *O11yHostRecord) SetMemory(v float64) {
o.Memory = &v
}
// GetMeta returns the Meta field value if set, zero value otherwise.
func (o *O11yHostRecord) 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 *O11yHostRecord) 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 *O11yHostRecord) 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 *O11yHostRecord) SetMeta(v map[string]string) {
o.Meta = v
}
// GetStatus returns the Status field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *O11yHostRecord) GetStatus() interface{} {
if o == nil {
var ret interface{}
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.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *O11yHostRecord) GetStatusOk() (*interface{}, 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 *O11yHostRecord) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given interface{} and assigns it to the Status field.
func (o *O11yHostRecord) SetStatus(v interface{}) {
o.Status = v
}
// GetWait returns the Wait field value if set, zero value otherwise.
func (o *O11yHostRecord) GetWait() float64 {
if o == nil || IsNil(o.Wait) {
var ret float64
return ret
}
return *o.Wait
}
// GetWaitOk returns a tuple with the Wait field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yHostRecord) GetWaitOk() (*float64, bool) {
if o == nil || IsNil(o.Wait) {
return nil, false
}
return o.Wait, true
}
// HasWait returns a boolean if a field has been set.
func (o *O11yHostRecord) HasWait() bool {
if o != nil && !IsNil(o.Wait) {
return true
}
return false
}
// SetWait gets a reference to the given float64 and assigns it to the Wait field.
func (o *O11yHostRecord) SetWait(v float64) {
o.Wait = &v
}
func (o O11yHostRecord) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o O11yHostRecord) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ActiveHostCount) {
toSerialize["activeHostCount"] = o.ActiveHostCount
}
if !IsNil(o.Cpu) {
toSerialize["cpu"] = o.Cpu
}
if !IsNil(o.DiskUsage) {
toSerialize["diskUsage"] = o.DiskUsage
}
if !IsNil(o.HostName) {
toSerialize["hostName"] = o.HostName
}
if !IsNil(o.InactiveHostCount) {
toSerialize["inactiveHostCount"] = o.InactiveHostCount
}
if !IsNil(o.Load15) {
toSerialize["load15"] = o.Load15
}
if !IsNil(o.Memory) {
toSerialize["memory"] = o.Memory
}
if !IsNil(o.Meta) {
toSerialize["meta"] = o.Meta
}
if o.Status != nil {
toSerialize["status"] = o.Status
}
if !IsNil(o.Wait) {
toSerialize["wait"] = o.Wait
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *O11yHostRecord) UnmarshalJSON(data []byte) (err error) {
varO11yHostRecord := _O11yHostRecord{}
err = json.Unmarshal(data, &varO11yHostRecord)
if err != nil {
return err
}
*o = O11yHostRecord(varO11yHostRecord)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "activeHostCount")
delete(additionalProperties, "cpu")
delete(additionalProperties, "diskUsage")
delete(additionalProperties, "hostName")
delete(additionalProperties, "inactiveHostCount")
delete(additionalProperties, "load15")
delete(additionalProperties, "memory")
delete(additionalProperties, "meta")
delete(additionalProperties, "status")
delete(additionalProperties, "wait")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableO11yHostRecord struct {
value *O11yHostRecord
isSet bool
}
func (v NullableO11yHostRecord) Get() *O11yHostRecord {
return v.value
}
func (v *NullableO11yHostRecord) Set(val *O11yHostRecord) {
v.value = val
v.isSet = true
}
func (v NullableO11yHostRecord) IsSet() bool {
return v.isSet
}
func (v *NullableO11yHostRecord) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableO11yHostRecord(val *O11yHostRecord) *NullableO11yHostRecord {
return &NullableO11yHostRecord{value: val, isSet: true}
}
func (v NullableO11yHostRecord) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableO11yHostRecord) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}