Files
sdk/model_agent_resource_usage.go

269 lines
7.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 AgentResourceUsage type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AgentResourceUsage{}
// AgentResourceUsage struct for AgentResourceUsage
type AgentResourceUsage struct {
// CostCents would be the window's spend in cents. Always null here — the money a run costs is the metering ledger's, joined by the run id, and repeating it from this side would be a second number that could disagree with the bill.
CostCents *float64 `json:"costCents,omitempty"`
// CPUVcpuHours would be vCPU-hours over the window. Always null: this store holds agent definitions and run I/O, and nothing here meters a CPU. Null is the honest answer and 0 would be a claim.
CpuVcpuHours *float64 `json:"cpuVcpuHours,omitempty"`
// MemGbHours would be gigabyte-hours of memory. Always null, same reason.
MemGbHours *float64 `json:"memGbHours,omitempty"`
// StorageIoBytes would be bytes moved to and from storage. Always null, same reason.
StorageIoBytes *float64 `json:"storageIoBytes,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AgentResourceUsage AgentResourceUsage
// NewAgentResourceUsage instantiates a new AgentResourceUsage 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 NewAgentResourceUsage() *AgentResourceUsage {
this := AgentResourceUsage{}
return &this
}
// NewAgentResourceUsageWithDefaults instantiates a new AgentResourceUsage 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 NewAgentResourceUsageWithDefaults() *AgentResourceUsage {
this := AgentResourceUsage{}
return &this
}
// GetCostCents returns the CostCents field value if set, zero value otherwise.
func (o *AgentResourceUsage) GetCostCents() float64 {
if o == nil || IsNil(o.CostCents) {
var ret float64
return ret
}
return *o.CostCents
}
// GetCostCentsOk returns a tuple with the CostCents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentResourceUsage) GetCostCentsOk() (*float64, bool) {
if o == nil || IsNil(o.CostCents) {
return nil, false
}
return o.CostCents, true
}
// HasCostCents returns a boolean if a field has been set.
func (o *AgentResourceUsage) HasCostCents() bool {
if o != nil && !IsNil(o.CostCents) {
return true
}
return false
}
// SetCostCents gets a reference to the given float64 and assigns it to the CostCents field.
func (o *AgentResourceUsage) SetCostCents(v float64) {
o.CostCents = &v
}
// GetCpuVcpuHours returns the CpuVcpuHours field value if set, zero value otherwise.
func (o *AgentResourceUsage) GetCpuVcpuHours() float64 {
if o == nil || IsNil(o.CpuVcpuHours) {
var ret float64
return ret
}
return *o.CpuVcpuHours
}
// GetCpuVcpuHoursOk returns a tuple with the CpuVcpuHours field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentResourceUsage) GetCpuVcpuHoursOk() (*float64, bool) {
if o == nil || IsNil(o.CpuVcpuHours) {
return nil, false
}
return o.CpuVcpuHours, true
}
// HasCpuVcpuHours returns a boolean if a field has been set.
func (o *AgentResourceUsage) HasCpuVcpuHours() bool {
if o != nil && !IsNil(o.CpuVcpuHours) {
return true
}
return false
}
// SetCpuVcpuHours gets a reference to the given float64 and assigns it to the CpuVcpuHours field.
func (o *AgentResourceUsage) SetCpuVcpuHours(v float64) {
o.CpuVcpuHours = &v
}
// GetMemGbHours returns the MemGbHours field value if set, zero value otherwise.
func (o *AgentResourceUsage) GetMemGbHours() float64 {
if o == nil || IsNil(o.MemGbHours) {
var ret float64
return ret
}
return *o.MemGbHours
}
// GetMemGbHoursOk returns a tuple with the MemGbHours field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentResourceUsage) GetMemGbHoursOk() (*float64, bool) {
if o == nil || IsNil(o.MemGbHours) {
return nil, false
}
return o.MemGbHours, true
}
// HasMemGbHours returns a boolean if a field has been set.
func (o *AgentResourceUsage) HasMemGbHours() bool {
if o != nil && !IsNil(o.MemGbHours) {
return true
}
return false
}
// SetMemGbHours gets a reference to the given float64 and assigns it to the MemGbHours field.
func (o *AgentResourceUsage) SetMemGbHours(v float64) {
o.MemGbHours = &v
}
// GetStorageIoBytes returns the StorageIoBytes field value if set, zero value otherwise.
func (o *AgentResourceUsage) GetStorageIoBytes() float64 {
if o == nil || IsNil(o.StorageIoBytes) {
var ret float64
return ret
}
return *o.StorageIoBytes
}
// GetStorageIoBytesOk returns a tuple with the StorageIoBytes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AgentResourceUsage) GetStorageIoBytesOk() (*float64, bool) {
if o == nil || IsNil(o.StorageIoBytes) {
return nil, false
}
return o.StorageIoBytes, true
}
// HasStorageIoBytes returns a boolean if a field has been set.
func (o *AgentResourceUsage) HasStorageIoBytes() bool {
if o != nil && !IsNil(o.StorageIoBytes) {
return true
}
return false
}
// SetStorageIoBytes gets a reference to the given float64 and assigns it to the StorageIoBytes field.
func (o *AgentResourceUsage) SetStorageIoBytes(v float64) {
o.StorageIoBytes = &v
}
func (o AgentResourceUsage) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AgentResourceUsage) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CostCents) {
toSerialize["costCents"] = o.CostCents
}
if !IsNil(o.CpuVcpuHours) {
toSerialize["cpuVcpuHours"] = o.CpuVcpuHours
}
if !IsNil(o.MemGbHours) {
toSerialize["memGbHours"] = o.MemGbHours
}
if !IsNil(o.StorageIoBytes) {
toSerialize["storageIoBytes"] = o.StorageIoBytes
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AgentResourceUsage) UnmarshalJSON(data []byte) (err error) {
varAgentResourceUsage := _AgentResourceUsage{}
err = json.Unmarshal(data, &varAgentResourceUsage)
if err != nil {
return err
}
*o = AgentResourceUsage(varAgentResourceUsage)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "costCents")
delete(additionalProperties, "cpuVcpuHours")
delete(additionalProperties, "memGbHours")
delete(additionalProperties, "storageIoBytes")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAgentResourceUsage struct {
value *AgentResourceUsage
isSet bool
}
func (v NullableAgentResourceUsage) Get() *AgentResourceUsage {
return v.value
}
func (v *NullableAgentResourceUsage) Set(val *AgentResourceUsage) {
v.value = val
v.isSet = true
}
func (v NullableAgentResourceUsage) IsSet() bool {
return v.isSet
}
func (v *NullableAgentResourceUsage) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAgentResourceUsage(val *AgentResourceUsage) *NullableAgentResourceUsage {
return &NullableAgentResourceUsage{value: val, isSet: true}
}
func (v NullableAgentResourceUsage) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAgentResourceUsage) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}