mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
6.8 KiB
Go
269 lines
6.8 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 EvalLatencyStat type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &EvalLatencyStat{}
|
|
|
|
// EvalLatencyStat struct for EvalLatencyStat
|
|
type EvalLatencyStat struct {
|
|
// false when no GenAI spans carry timing; the percentiles are then null
|
|
Available *bool `json:"available,omitempty"`
|
|
// median latency over the window
|
|
P50Ms *float64 `json:"p50Ms,omitempty"`
|
|
// 95th-percentile latency
|
|
P95Ms *float64 `json:"p95Ms,omitempty"`
|
|
// 99th-percentile latency
|
|
P99Ms *float64 `json:"p99Ms,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _EvalLatencyStat EvalLatencyStat
|
|
|
|
// NewEvalLatencyStat instantiates a new EvalLatencyStat 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 NewEvalLatencyStat() *EvalLatencyStat {
|
|
this := EvalLatencyStat{}
|
|
return &this
|
|
}
|
|
|
|
// NewEvalLatencyStatWithDefaults instantiates a new EvalLatencyStat 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 NewEvalLatencyStatWithDefaults() *EvalLatencyStat {
|
|
this := EvalLatencyStat{}
|
|
return &this
|
|
}
|
|
|
|
// GetAvailable returns the Available field value if set, zero value otherwise.
|
|
func (o *EvalLatencyStat) GetAvailable() bool {
|
|
if o == nil || IsNil(o.Available) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Available
|
|
}
|
|
|
|
// GetAvailableOk returns a tuple with the Available field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EvalLatencyStat) GetAvailableOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Available) {
|
|
return nil, false
|
|
}
|
|
return o.Available, true
|
|
}
|
|
|
|
// HasAvailable returns a boolean if a field has been set.
|
|
func (o *EvalLatencyStat) HasAvailable() bool {
|
|
if o != nil && !IsNil(o.Available) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAvailable gets a reference to the given bool and assigns it to the Available field.
|
|
func (o *EvalLatencyStat) SetAvailable(v bool) {
|
|
o.Available = &v
|
|
}
|
|
|
|
// GetP50Ms returns the P50Ms field value if set, zero value otherwise.
|
|
func (o *EvalLatencyStat) GetP50Ms() float64 {
|
|
if o == nil || IsNil(o.P50Ms) {
|
|
var ret float64
|
|
return ret
|
|
}
|
|
return *o.P50Ms
|
|
}
|
|
|
|
// GetP50MsOk returns a tuple with the P50Ms field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EvalLatencyStat) GetP50MsOk() (*float64, bool) {
|
|
if o == nil || IsNil(o.P50Ms) {
|
|
return nil, false
|
|
}
|
|
return o.P50Ms, true
|
|
}
|
|
|
|
// HasP50Ms returns a boolean if a field has been set.
|
|
func (o *EvalLatencyStat) HasP50Ms() bool {
|
|
if o != nil && !IsNil(o.P50Ms) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetP50Ms gets a reference to the given float64 and assigns it to the P50Ms field.
|
|
func (o *EvalLatencyStat) SetP50Ms(v float64) {
|
|
o.P50Ms = &v
|
|
}
|
|
|
|
// GetP95Ms returns the P95Ms field value if set, zero value otherwise.
|
|
func (o *EvalLatencyStat) GetP95Ms() float64 {
|
|
if o == nil || IsNil(o.P95Ms) {
|
|
var ret float64
|
|
return ret
|
|
}
|
|
return *o.P95Ms
|
|
}
|
|
|
|
// GetP95MsOk returns a tuple with the P95Ms field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EvalLatencyStat) GetP95MsOk() (*float64, bool) {
|
|
if o == nil || IsNil(o.P95Ms) {
|
|
return nil, false
|
|
}
|
|
return o.P95Ms, true
|
|
}
|
|
|
|
// HasP95Ms returns a boolean if a field has been set.
|
|
func (o *EvalLatencyStat) HasP95Ms() bool {
|
|
if o != nil && !IsNil(o.P95Ms) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetP95Ms gets a reference to the given float64 and assigns it to the P95Ms field.
|
|
func (o *EvalLatencyStat) SetP95Ms(v float64) {
|
|
o.P95Ms = &v
|
|
}
|
|
|
|
// GetP99Ms returns the P99Ms field value if set, zero value otherwise.
|
|
func (o *EvalLatencyStat) GetP99Ms() float64 {
|
|
if o == nil || IsNil(o.P99Ms) {
|
|
var ret float64
|
|
return ret
|
|
}
|
|
return *o.P99Ms
|
|
}
|
|
|
|
// GetP99MsOk returns a tuple with the P99Ms field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EvalLatencyStat) GetP99MsOk() (*float64, bool) {
|
|
if o == nil || IsNil(o.P99Ms) {
|
|
return nil, false
|
|
}
|
|
return o.P99Ms, true
|
|
}
|
|
|
|
// HasP99Ms returns a boolean if a field has been set.
|
|
func (o *EvalLatencyStat) HasP99Ms() bool {
|
|
if o != nil && !IsNil(o.P99Ms) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetP99Ms gets a reference to the given float64 and assigns it to the P99Ms field.
|
|
func (o *EvalLatencyStat) SetP99Ms(v float64) {
|
|
o.P99Ms = &v
|
|
}
|
|
|
|
func (o EvalLatencyStat) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o EvalLatencyStat) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Available) {
|
|
toSerialize["available"] = o.Available
|
|
}
|
|
if !IsNil(o.P50Ms) {
|
|
toSerialize["p50Ms"] = o.P50Ms
|
|
}
|
|
if !IsNil(o.P95Ms) {
|
|
toSerialize["p95Ms"] = o.P95Ms
|
|
}
|
|
if !IsNil(o.P99Ms) {
|
|
toSerialize["p99Ms"] = o.P99Ms
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *EvalLatencyStat) UnmarshalJSON(data []byte) (err error) {
|
|
varEvalLatencyStat := _EvalLatencyStat{}
|
|
|
|
err = json.Unmarshal(data, &varEvalLatencyStat)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = EvalLatencyStat(varEvalLatencyStat)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "available")
|
|
delete(additionalProperties, "p50Ms")
|
|
delete(additionalProperties, "p95Ms")
|
|
delete(additionalProperties, "p99Ms")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableEvalLatencyStat struct {
|
|
value *EvalLatencyStat
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableEvalLatencyStat) Get() *EvalLatencyStat {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableEvalLatencyStat) Set(val *EvalLatencyStat) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableEvalLatencyStat) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableEvalLatencyStat) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableEvalLatencyStat(val *EvalLatencyStat) *NullableEvalLatencyStat {
|
|
return &NullableEvalLatencyStat{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableEvalLatencyStat) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableEvalLatencyStat) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|