mirror of
https://github.com/hanzoai/apiclient.git
synced 2026-10-30 18:47:47 +00:00
Generated from Runtime's OpenAPI document, and pure standard library — it requires nothing else, so a caller pays only for this package. It lives here rather than inside Runtime because a nested module is resolved by the path it declares, and one declaring a path it does not sit at is reachable by nobody: no proxy answers for it and no consumer can name it. Co-authored-by: Hanzo Dev <[email protected]>
326 lines
8.4 KiB
Go
326 lines
8.4 KiB
Go
/*
|
|
Runtime
|
|
|
|
Runtime AI platform API Docs
|
|
|
|
API version: 1.0
|
|
Contact: [email protected]
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package apiclient
|
|
|
|
import (
|
|
"bytes"
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
// checks if the UsageOverview type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &UsageOverview{}
|
|
|
|
// UsageOverview struct for UsageOverview
|
|
type UsageOverview struct {
|
|
TotalCpuQuota float32 `json:"totalCpuQuota"`
|
|
TotalGpuQuota float32 `json:"totalGpuQuota"`
|
|
TotalMemoryQuota float32 `json:"totalMemoryQuota"`
|
|
TotalDiskQuota float32 `json:"totalDiskQuota"`
|
|
CurrentCpuUsage float32 `json:"currentCpuUsage"`
|
|
CurrentMemoryUsage float32 `json:"currentMemoryUsage"`
|
|
CurrentDiskUsage float32 `json:"currentDiskUsage"`
|
|
}
|
|
|
|
type _UsageOverview UsageOverview
|
|
|
|
// NewUsageOverview instantiates a new UsageOverview 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 NewUsageOverview(totalCpuQuota float32, totalGpuQuota float32, totalMemoryQuota float32, totalDiskQuota float32, currentCpuUsage float32, currentMemoryUsage float32, currentDiskUsage float32) *UsageOverview {
|
|
this := UsageOverview{}
|
|
this.TotalCpuQuota = totalCpuQuota
|
|
this.TotalGpuQuota = totalGpuQuota
|
|
this.TotalMemoryQuota = totalMemoryQuota
|
|
this.TotalDiskQuota = totalDiskQuota
|
|
this.CurrentCpuUsage = currentCpuUsage
|
|
this.CurrentMemoryUsage = currentMemoryUsage
|
|
this.CurrentDiskUsage = currentDiskUsage
|
|
return &this
|
|
}
|
|
|
|
// NewUsageOverviewWithDefaults instantiates a new UsageOverview 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 NewUsageOverviewWithDefaults() *UsageOverview {
|
|
this := UsageOverview{}
|
|
return &this
|
|
}
|
|
|
|
// GetTotalCpuQuota returns the TotalCpuQuota field value
|
|
func (o *UsageOverview) GetTotalCpuQuota() float32 {
|
|
if o == nil {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
|
|
return o.TotalCpuQuota
|
|
}
|
|
|
|
// GetTotalCpuQuotaOk returns a tuple with the TotalCpuQuota field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UsageOverview) GetTotalCpuQuotaOk() (*float32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.TotalCpuQuota, true
|
|
}
|
|
|
|
// SetTotalCpuQuota sets field value
|
|
func (o *UsageOverview) SetTotalCpuQuota(v float32) {
|
|
o.TotalCpuQuota = v
|
|
}
|
|
|
|
// GetTotalGpuQuota returns the TotalGpuQuota field value
|
|
func (o *UsageOverview) GetTotalGpuQuota() float32 {
|
|
if o == nil {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
|
|
return o.TotalGpuQuota
|
|
}
|
|
|
|
// GetTotalGpuQuotaOk returns a tuple with the TotalGpuQuota field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UsageOverview) GetTotalGpuQuotaOk() (*float32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.TotalGpuQuota, true
|
|
}
|
|
|
|
// SetTotalGpuQuota sets field value
|
|
func (o *UsageOverview) SetTotalGpuQuota(v float32) {
|
|
o.TotalGpuQuota = v
|
|
}
|
|
|
|
// GetTotalMemoryQuota returns the TotalMemoryQuota field value
|
|
func (o *UsageOverview) GetTotalMemoryQuota() float32 {
|
|
if o == nil {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
|
|
return o.TotalMemoryQuota
|
|
}
|
|
|
|
// GetTotalMemoryQuotaOk returns a tuple with the TotalMemoryQuota field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UsageOverview) GetTotalMemoryQuotaOk() (*float32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.TotalMemoryQuota, true
|
|
}
|
|
|
|
// SetTotalMemoryQuota sets field value
|
|
func (o *UsageOverview) SetTotalMemoryQuota(v float32) {
|
|
o.TotalMemoryQuota = v
|
|
}
|
|
|
|
// GetTotalDiskQuota returns the TotalDiskQuota field value
|
|
func (o *UsageOverview) GetTotalDiskQuota() float32 {
|
|
if o == nil {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
|
|
return o.TotalDiskQuota
|
|
}
|
|
|
|
// GetTotalDiskQuotaOk returns a tuple with the TotalDiskQuota field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UsageOverview) GetTotalDiskQuotaOk() (*float32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.TotalDiskQuota, true
|
|
}
|
|
|
|
// SetTotalDiskQuota sets field value
|
|
func (o *UsageOverview) SetTotalDiskQuota(v float32) {
|
|
o.TotalDiskQuota = v
|
|
}
|
|
|
|
// GetCurrentCpuUsage returns the CurrentCpuUsage field value
|
|
func (o *UsageOverview) GetCurrentCpuUsage() float32 {
|
|
if o == nil {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
|
|
return o.CurrentCpuUsage
|
|
}
|
|
|
|
// GetCurrentCpuUsageOk returns a tuple with the CurrentCpuUsage field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UsageOverview) GetCurrentCpuUsageOk() (*float32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.CurrentCpuUsage, true
|
|
}
|
|
|
|
// SetCurrentCpuUsage sets field value
|
|
func (o *UsageOverview) SetCurrentCpuUsage(v float32) {
|
|
o.CurrentCpuUsage = v
|
|
}
|
|
|
|
// GetCurrentMemoryUsage returns the CurrentMemoryUsage field value
|
|
func (o *UsageOverview) GetCurrentMemoryUsage() float32 {
|
|
if o == nil {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
|
|
return o.CurrentMemoryUsage
|
|
}
|
|
|
|
// GetCurrentMemoryUsageOk returns a tuple with the CurrentMemoryUsage field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UsageOverview) GetCurrentMemoryUsageOk() (*float32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.CurrentMemoryUsage, true
|
|
}
|
|
|
|
// SetCurrentMemoryUsage sets field value
|
|
func (o *UsageOverview) SetCurrentMemoryUsage(v float32) {
|
|
o.CurrentMemoryUsage = v
|
|
}
|
|
|
|
// GetCurrentDiskUsage returns the CurrentDiskUsage field value
|
|
func (o *UsageOverview) GetCurrentDiskUsage() float32 {
|
|
if o == nil {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
|
|
return o.CurrentDiskUsage
|
|
}
|
|
|
|
// GetCurrentDiskUsageOk returns a tuple with the CurrentDiskUsage field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UsageOverview) GetCurrentDiskUsageOk() (*float32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.CurrentDiskUsage, true
|
|
}
|
|
|
|
// SetCurrentDiskUsage sets field value
|
|
func (o *UsageOverview) SetCurrentDiskUsage(v float32) {
|
|
o.CurrentDiskUsage = v
|
|
}
|
|
|
|
func (o UsageOverview) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o UsageOverview) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
toSerialize["totalCpuQuota"] = o.TotalCpuQuota
|
|
toSerialize["totalGpuQuota"] = o.TotalGpuQuota
|
|
toSerialize["totalMemoryQuota"] = o.TotalMemoryQuota
|
|
toSerialize["totalDiskQuota"] = o.TotalDiskQuota
|
|
toSerialize["currentCpuUsage"] = o.CurrentCpuUsage
|
|
toSerialize["currentMemoryUsage"] = o.CurrentMemoryUsage
|
|
toSerialize["currentDiskUsage"] = o.CurrentDiskUsage
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *UsageOverview) UnmarshalJSON(data []byte) (err error) {
|
|
// This validates that all required properties are included in the JSON object
|
|
// by unmarshalling the object into a generic map with string keys and checking
|
|
// that every required field exists as a key in the generic map.
|
|
requiredProperties := []string{
|
|
"totalCpuQuota",
|
|
"totalGpuQuota",
|
|
"totalMemoryQuota",
|
|
"totalDiskQuota",
|
|
"currentCpuUsage",
|
|
"currentMemoryUsage",
|
|
"currentDiskUsage",
|
|
}
|
|
|
|
allProperties := make(map[string]interface{})
|
|
|
|
err = json.Unmarshal(data, &allProperties)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
for _, requiredProperty := range requiredProperties {
|
|
if _, exists := allProperties[requiredProperty]; !exists {
|
|
return fmt.Errorf("no value given for required property %v", requiredProperty)
|
|
}
|
|
}
|
|
|
|
varUsageOverview := _UsageOverview{}
|
|
|
|
decoder := json.NewDecoder(bytes.NewReader(data))
|
|
decoder.DisallowUnknownFields()
|
|
err = decoder.Decode(&varUsageOverview)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = UsageOverview(varUsageOverview)
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableUsageOverview struct {
|
|
value *UsageOverview
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableUsageOverview) Get() *UsageOverview {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableUsageOverview) Set(val *UsageOverview) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableUsageOverview) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableUsageOverview) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableUsageOverview(val *UsageOverview) *NullableUsageOverview {
|
|
return &NullableUsageOverview{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableUsageOverview) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableUsageOverview) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|