Files
sdk/model_ai_quality_stats.go

302 lines
8.3 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 AiQualityStats type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AiQualityStats{}
// AiQualityStats struct for AiQualityStats
type AiQualityStats struct {
AvgConfidence *float32 `json:"avg_confidence,omitempty"`
LearnedShare *float32 `json:"learned_share,omitempty"`
RewardRate *float32 `json:"reward_rate,omitempty"`
RewardedEvents *int32 `json:"rewarded_events,omitempty"`
ShadowAgreement *float32 `json:"shadow_agreement,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AiQualityStats AiQualityStats
// NewAiQualityStats instantiates a new AiQualityStats 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 NewAiQualityStats() *AiQualityStats {
this := AiQualityStats{}
return &this
}
// NewAiQualityStatsWithDefaults instantiates a new AiQualityStats 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 NewAiQualityStatsWithDefaults() *AiQualityStats {
this := AiQualityStats{}
return &this
}
// GetAvgConfidence returns the AvgConfidence field value if set, zero value otherwise.
func (o *AiQualityStats) GetAvgConfidence() float32 {
if o == nil || IsNil(o.AvgConfidence) {
var ret float32
return ret
}
return *o.AvgConfidence
}
// GetAvgConfidenceOk returns a tuple with the AvgConfidence field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiQualityStats) GetAvgConfidenceOk() (*float32, bool) {
if o == nil || IsNil(o.AvgConfidence) {
return nil, false
}
return o.AvgConfidence, true
}
// HasAvgConfidence returns a boolean if a field has been set.
func (o *AiQualityStats) HasAvgConfidence() bool {
if o != nil && !IsNil(o.AvgConfidence) {
return true
}
return false
}
// SetAvgConfidence gets a reference to the given float32 and assigns it to the AvgConfidence field.
func (o *AiQualityStats) SetAvgConfidence(v float32) {
o.AvgConfidence = &v
}
// GetLearnedShare returns the LearnedShare field value if set, zero value otherwise.
func (o *AiQualityStats) GetLearnedShare() float32 {
if o == nil || IsNil(o.LearnedShare) {
var ret float32
return ret
}
return *o.LearnedShare
}
// GetLearnedShareOk returns a tuple with the LearnedShare field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiQualityStats) GetLearnedShareOk() (*float32, bool) {
if o == nil || IsNil(o.LearnedShare) {
return nil, false
}
return o.LearnedShare, true
}
// HasLearnedShare returns a boolean if a field has been set.
func (o *AiQualityStats) HasLearnedShare() bool {
if o != nil && !IsNil(o.LearnedShare) {
return true
}
return false
}
// SetLearnedShare gets a reference to the given float32 and assigns it to the LearnedShare field.
func (o *AiQualityStats) SetLearnedShare(v float32) {
o.LearnedShare = &v
}
// GetRewardRate returns the RewardRate field value if set, zero value otherwise.
func (o *AiQualityStats) GetRewardRate() float32 {
if o == nil || IsNil(o.RewardRate) {
var ret float32
return ret
}
return *o.RewardRate
}
// GetRewardRateOk returns a tuple with the RewardRate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiQualityStats) GetRewardRateOk() (*float32, bool) {
if o == nil || IsNil(o.RewardRate) {
return nil, false
}
return o.RewardRate, true
}
// HasRewardRate returns a boolean if a field has been set.
func (o *AiQualityStats) HasRewardRate() bool {
if o != nil && !IsNil(o.RewardRate) {
return true
}
return false
}
// SetRewardRate gets a reference to the given float32 and assigns it to the RewardRate field.
func (o *AiQualityStats) SetRewardRate(v float32) {
o.RewardRate = &v
}
// GetRewardedEvents returns the RewardedEvents field value if set, zero value otherwise.
func (o *AiQualityStats) GetRewardedEvents() int32 {
if o == nil || IsNil(o.RewardedEvents) {
var ret int32
return ret
}
return *o.RewardedEvents
}
// GetRewardedEventsOk returns a tuple with the RewardedEvents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiQualityStats) GetRewardedEventsOk() (*int32, bool) {
if o == nil || IsNil(o.RewardedEvents) {
return nil, false
}
return o.RewardedEvents, true
}
// HasRewardedEvents returns a boolean if a field has been set.
func (o *AiQualityStats) HasRewardedEvents() bool {
if o != nil && !IsNil(o.RewardedEvents) {
return true
}
return false
}
// SetRewardedEvents gets a reference to the given int32 and assigns it to the RewardedEvents field.
func (o *AiQualityStats) SetRewardedEvents(v int32) {
o.RewardedEvents = &v
}
// GetShadowAgreement returns the ShadowAgreement field value if set, zero value otherwise.
func (o *AiQualityStats) GetShadowAgreement() float32 {
if o == nil || IsNil(o.ShadowAgreement) {
var ret float32
return ret
}
return *o.ShadowAgreement
}
// GetShadowAgreementOk returns a tuple with the ShadowAgreement field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiQualityStats) GetShadowAgreementOk() (*float32, bool) {
if o == nil || IsNil(o.ShadowAgreement) {
return nil, false
}
return o.ShadowAgreement, true
}
// HasShadowAgreement returns a boolean if a field has been set.
func (o *AiQualityStats) HasShadowAgreement() bool {
if o != nil && !IsNil(o.ShadowAgreement) {
return true
}
return false
}
// SetShadowAgreement gets a reference to the given float32 and assigns it to the ShadowAgreement field.
func (o *AiQualityStats) SetShadowAgreement(v float32) {
o.ShadowAgreement = &v
}
func (o AiQualityStats) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AiQualityStats) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AvgConfidence) {
toSerialize["avg_confidence"] = o.AvgConfidence
}
if !IsNil(o.LearnedShare) {
toSerialize["learned_share"] = o.LearnedShare
}
if !IsNil(o.RewardRate) {
toSerialize["reward_rate"] = o.RewardRate
}
if !IsNil(o.RewardedEvents) {
toSerialize["rewarded_events"] = o.RewardedEvents
}
if !IsNil(o.ShadowAgreement) {
toSerialize["shadow_agreement"] = o.ShadowAgreement
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AiQualityStats) UnmarshalJSON(data []byte) (err error) {
varAiQualityStats := _AiQualityStats{}
err = json.Unmarshal(data, &varAiQualityStats)
if err != nil {
return err
}
*o = AiQualityStats(varAiQualityStats)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "avg_confidence")
delete(additionalProperties, "learned_share")
delete(additionalProperties, "reward_rate")
delete(additionalProperties, "rewarded_events")
delete(additionalProperties, "shadow_agreement")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAiQualityStats struct {
value *AiQualityStats
isSet bool
}
func (v NullableAiQualityStats) Get() *AiQualityStats {
return v.value
}
func (v *NullableAiQualityStats) Set(val *AiQualityStats) {
v.value = val
v.isSet = true
}
func (v NullableAiQualityStats) IsSet() bool {
return v.isSet
}
func (v *NullableAiQualityStats) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAiQualityStats(val *AiQualityStats) *NullableAiQualityStats {
return &NullableAiQualityStats{value: val, isSet: true}
}
func (v NullableAiQualityStats) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAiQualityStats) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}