mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
339 lines
9.4 KiB
Go
339 lines
9.4 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 AiCostStats type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AiCostStats{}
|
|
|
|
// AiCostStats struct for AiCostStats
|
|
type AiCostStats struct {
|
|
BaselineModel *string `json:"baseline_model,omitempty"`
|
|
CounterfactualIndex *float32 `json:"counterfactual_index,omitempty"`
|
|
CumulativeSavedIndex *float32 `json:"cumulative_saved_index,omitempty"`
|
|
PricedEvents *int32 `json:"priced_events,omitempty"`
|
|
RoutedIndex *float32 `json:"routed_index,omitempty"`
|
|
SavedPct *float32 `json:"saved_pct,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AiCostStats AiCostStats
|
|
|
|
// NewAiCostStats instantiates a new AiCostStats 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 NewAiCostStats() *AiCostStats {
|
|
this := AiCostStats{}
|
|
return &this
|
|
}
|
|
|
|
// NewAiCostStatsWithDefaults instantiates a new AiCostStats 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 NewAiCostStatsWithDefaults() *AiCostStats {
|
|
this := AiCostStats{}
|
|
return &this
|
|
}
|
|
|
|
// GetBaselineModel returns the BaselineModel field value if set, zero value otherwise.
|
|
func (o *AiCostStats) GetBaselineModel() string {
|
|
if o == nil || IsNil(o.BaselineModel) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.BaselineModel
|
|
}
|
|
|
|
// GetBaselineModelOk returns a tuple with the BaselineModel field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiCostStats) GetBaselineModelOk() (*string, bool) {
|
|
if o == nil || IsNil(o.BaselineModel) {
|
|
return nil, false
|
|
}
|
|
return o.BaselineModel, true
|
|
}
|
|
|
|
// HasBaselineModel returns a boolean if a field has been set.
|
|
func (o *AiCostStats) HasBaselineModel() bool {
|
|
if o != nil && !IsNil(o.BaselineModel) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetBaselineModel gets a reference to the given string and assigns it to the BaselineModel field.
|
|
func (o *AiCostStats) SetBaselineModel(v string) {
|
|
o.BaselineModel = &v
|
|
}
|
|
|
|
// GetCounterfactualIndex returns the CounterfactualIndex field value if set, zero value otherwise.
|
|
func (o *AiCostStats) GetCounterfactualIndex() float32 {
|
|
if o == nil || IsNil(o.CounterfactualIndex) {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
return *o.CounterfactualIndex
|
|
}
|
|
|
|
// GetCounterfactualIndexOk returns a tuple with the CounterfactualIndex field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiCostStats) GetCounterfactualIndexOk() (*float32, bool) {
|
|
if o == nil || IsNil(o.CounterfactualIndex) {
|
|
return nil, false
|
|
}
|
|
return o.CounterfactualIndex, true
|
|
}
|
|
|
|
// HasCounterfactualIndex returns a boolean if a field has been set.
|
|
func (o *AiCostStats) HasCounterfactualIndex() bool {
|
|
if o != nil && !IsNil(o.CounterfactualIndex) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCounterfactualIndex gets a reference to the given float32 and assigns it to the CounterfactualIndex field.
|
|
func (o *AiCostStats) SetCounterfactualIndex(v float32) {
|
|
o.CounterfactualIndex = &v
|
|
}
|
|
|
|
// GetCumulativeSavedIndex returns the CumulativeSavedIndex field value if set, zero value otherwise.
|
|
func (o *AiCostStats) GetCumulativeSavedIndex() float32 {
|
|
if o == nil || IsNil(o.CumulativeSavedIndex) {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
return *o.CumulativeSavedIndex
|
|
}
|
|
|
|
// GetCumulativeSavedIndexOk returns a tuple with the CumulativeSavedIndex field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiCostStats) GetCumulativeSavedIndexOk() (*float32, bool) {
|
|
if o == nil || IsNil(o.CumulativeSavedIndex) {
|
|
return nil, false
|
|
}
|
|
return o.CumulativeSavedIndex, true
|
|
}
|
|
|
|
// HasCumulativeSavedIndex returns a boolean if a field has been set.
|
|
func (o *AiCostStats) HasCumulativeSavedIndex() bool {
|
|
if o != nil && !IsNil(o.CumulativeSavedIndex) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCumulativeSavedIndex gets a reference to the given float32 and assigns it to the CumulativeSavedIndex field.
|
|
func (o *AiCostStats) SetCumulativeSavedIndex(v float32) {
|
|
o.CumulativeSavedIndex = &v
|
|
}
|
|
|
|
// GetPricedEvents returns the PricedEvents field value if set, zero value otherwise.
|
|
func (o *AiCostStats) GetPricedEvents() int32 {
|
|
if o == nil || IsNil(o.PricedEvents) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.PricedEvents
|
|
}
|
|
|
|
// GetPricedEventsOk returns a tuple with the PricedEvents field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiCostStats) GetPricedEventsOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.PricedEvents) {
|
|
return nil, false
|
|
}
|
|
return o.PricedEvents, true
|
|
}
|
|
|
|
// HasPricedEvents returns a boolean if a field has been set.
|
|
func (o *AiCostStats) HasPricedEvents() bool {
|
|
if o != nil && !IsNil(o.PricedEvents) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPricedEvents gets a reference to the given int32 and assigns it to the PricedEvents field.
|
|
func (o *AiCostStats) SetPricedEvents(v int32) {
|
|
o.PricedEvents = &v
|
|
}
|
|
|
|
// GetRoutedIndex returns the RoutedIndex field value if set, zero value otherwise.
|
|
func (o *AiCostStats) GetRoutedIndex() float32 {
|
|
if o == nil || IsNil(o.RoutedIndex) {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
return *o.RoutedIndex
|
|
}
|
|
|
|
// GetRoutedIndexOk returns a tuple with the RoutedIndex field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiCostStats) GetRoutedIndexOk() (*float32, bool) {
|
|
if o == nil || IsNil(o.RoutedIndex) {
|
|
return nil, false
|
|
}
|
|
return o.RoutedIndex, true
|
|
}
|
|
|
|
// HasRoutedIndex returns a boolean if a field has been set.
|
|
func (o *AiCostStats) HasRoutedIndex() bool {
|
|
if o != nil && !IsNil(o.RoutedIndex) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRoutedIndex gets a reference to the given float32 and assigns it to the RoutedIndex field.
|
|
func (o *AiCostStats) SetRoutedIndex(v float32) {
|
|
o.RoutedIndex = &v
|
|
}
|
|
|
|
// GetSavedPct returns the SavedPct field value if set, zero value otherwise.
|
|
func (o *AiCostStats) GetSavedPct() float32 {
|
|
if o == nil || IsNil(o.SavedPct) {
|
|
var ret float32
|
|
return ret
|
|
}
|
|
return *o.SavedPct
|
|
}
|
|
|
|
// GetSavedPctOk returns a tuple with the SavedPct field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiCostStats) GetSavedPctOk() (*float32, bool) {
|
|
if o == nil || IsNil(o.SavedPct) {
|
|
return nil, false
|
|
}
|
|
return o.SavedPct, true
|
|
}
|
|
|
|
// HasSavedPct returns a boolean if a field has been set.
|
|
func (o *AiCostStats) HasSavedPct() bool {
|
|
if o != nil && !IsNil(o.SavedPct) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSavedPct gets a reference to the given float32 and assigns it to the SavedPct field.
|
|
func (o *AiCostStats) SetSavedPct(v float32) {
|
|
o.SavedPct = &v
|
|
}
|
|
|
|
func (o AiCostStats) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AiCostStats) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.BaselineModel) {
|
|
toSerialize["baseline_model"] = o.BaselineModel
|
|
}
|
|
if !IsNil(o.CounterfactualIndex) {
|
|
toSerialize["counterfactual_index"] = o.CounterfactualIndex
|
|
}
|
|
if !IsNil(o.CumulativeSavedIndex) {
|
|
toSerialize["cumulative_saved_index"] = o.CumulativeSavedIndex
|
|
}
|
|
if !IsNil(o.PricedEvents) {
|
|
toSerialize["priced_events"] = o.PricedEvents
|
|
}
|
|
if !IsNil(o.RoutedIndex) {
|
|
toSerialize["routed_index"] = o.RoutedIndex
|
|
}
|
|
if !IsNil(o.SavedPct) {
|
|
toSerialize["saved_pct"] = o.SavedPct
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AiCostStats) UnmarshalJSON(data []byte) (err error) {
|
|
varAiCostStats := _AiCostStats{}
|
|
|
|
err = json.Unmarshal(data, &varAiCostStats)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AiCostStats(varAiCostStats)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "baseline_model")
|
|
delete(additionalProperties, "counterfactual_index")
|
|
delete(additionalProperties, "cumulative_saved_index")
|
|
delete(additionalProperties, "priced_events")
|
|
delete(additionalProperties, "routed_index")
|
|
delete(additionalProperties, "saved_pct")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAiCostStats struct {
|
|
value *AiCostStats
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAiCostStats) Get() *AiCostStats {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAiCostStats) Set(val *AiCostStats) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAiCostStats) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAiCostStats) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAiCostStats(val *AiCostStats) *NullableAiCostStats {
|
|
return &NullableAiCostStats{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAiCostStats) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAiCostStats) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|