mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
6.2 KiB
Go
231 lines
6.2 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 AgentMetricsView type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AgentMetricsView{}
|
|
|
|
// AgentMetricsView struct for AgentMetricsView
|
|
type AgentMetricsView struct {
|
|
// echoes the requested window (24H|7D|30D)
|
|
Range *string `json:"range,omitempty"`
|
|
// Resource is the Resource Usage panel's rollup, and every field of it is currently null — see resourceUsage. It is present rather than omitted so a panel renders \"—\" instead of guessing.
|
|
Resource *AgentResourceUsage `json:"resource,omitempty"`
|
|
// per-agent invocation histogram (real)
|
|
Series []AgentSeriesLine `json:"series,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AgentMetricsView AgentMetricsView
|
|
|
|
// NewAgentMetricsView instantiates a new AgentMetricsView 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 NewAgentMetricsView() *AgentMetricsView {
|
|
this := AgentMetricsView{}
|
|
return &this
|
|
}
|
|
|
|
// NewAgentMetricsViewWithDefaults instantiates a new AgentMetricsView 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 NewAgentMetricsViewWithDefaults() *AgentMetricsView {
|
|
this := AgentMetricsView{}
|
|
return &this
|
|
}
|
|
|
|
// GetRange returns the Range field value if set, zero value otherwise.
|
|
func (o *AgentMetricsView) GetRange() string {
|
|
if o == nil || IsNil(o.Range) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Range
|
|
}
|
|
|
|
// GetRangeOk returns a tuple with the Range field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentMetricsView) GetRangeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Range) {
|
|
return nil, false
|
|
}
|
|
return o.Range, true
|
|
}
|
|
|
|
// HasRange returns a boolean if a field has been set.
|
|
func (o *AgentMetricsView) HasRange() bool {
|
|
if o != nil && !IsNil(o.Range) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRange gets a reference to the given string and assigns it to the Range field.
|
|
func (o *AgentMetricsView) SetRange(v string) {
|
|
o.Range = &v
|
|
}
|
|
|
|
// GetResource returns the Resource field value if set, zero value otherwise.
|
|
func (o *AgentMetricsView) GetResource() AgentResourceUsage {
|
|
if o == nil || IsNil(o.Resource) {
|
|
var ret AgentResourceUsage
|
|
return ret
|
|
}
|
|
return *o.Resource
|
|
}
|
|
|
|
// GetResourceOk returns a tuple with the Resource field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentMetricsView) GetResourceOk() (*AgentResourceUsage, bool) {
|
|
if o == nil || IsNil(o.Resource) {
|
|
return nil, false
|
|
}
|
|
return o.Resource, true
|
|
}
|
|
|
|
// HasResource returns a boolean if a field has been set.
|
|
func (o *AgentMetricsView) HasResource() bool {
|
|
if o != nil && !IsNil(o.Resource) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetResource gets a reference to the given AgentResourceUsage and assigns it to the Resource field.
|
|
func (o *AgentMetricsView) SetResource(v AgentResourceUsage) {
|
|
o.Resource = &v
|
|
}
|
|
|
|
// GetSeries returns the Series field value if set, zero value otherwise.
|
|
func (o *AgentMetricsView) GetSeries() []AgentSeriesLine {
|
|
if o == nil || IsNil(o.Series) {
|
|
var ret []AgentSeriesLine
|
|
return ret
|
|
}
|
|
return o.Series
|
|
}
|
|
|
|
// GetSeriesOk returns a tuple with the Series field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AgentMetricsView) GetSeriesOk() ([]AgentSeriesLine, bool) {
|
|
if o == nil || IsNil(o.Series) {
|
|
return nil, false
|
|
}
|
|
return o.Series, true
|
|
}
|
|
|
|
// HasSeries returns a boolean if a field has been set.
|
|
func (o *AgentMetricsView) HasSeries() bool {
|
|
if o != nil && !IsNil(o.Series) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSeries gets a reference to the given []AgentSeriesLine and assigns it to the Series field.
|
|
func (o *AgentMetricsView) SetSeries(v []AgentSeriesLine) {
|
|
o.Series = v
|
|
}
|
|
|
|
func (o AgentMetricsView) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AgentMetricsView) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Range) {
|
|
toSerialize["range"] = o.Range
|
|
}
|
|
if !IsNil(o.Resource) {
|
|
toSerialize["resource"] = o.Resource
|
|
}
|
|
if !IsNil(o.Series) {
|
|
toSerialize["series"] = o.Series
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AgentMetricsView) UnmarshalJSON(data []byte) (err error) {
|
|
varAgentMetricsView := _AgentMetricsView{}
|
|
|
|
err = json.Unmarshal(data, &varAgentMetricsView)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AgentMetricsView(varAgentMetricsView)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "range")
|
|
delete(additionalProperties, "resource")
|
|
delete(additionalProperties, "series")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAgentMetricsView struct {
|
|
value *AgentMetricsView
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAgentMetricsView) Get() *AgentMetricsView {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAgentMetricsView) Set(val *AgentMetricsView) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAgentMetricsView) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAgentMetricsView) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAgentMetricsView(val *AgentMetricsView) *NullableAgentMetricsView {
|
|
return &NullableAgentMetricsView{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAgentMetricsView) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAgentMetricsView) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|