Files
sdk/model_benchmark_measurement.go

269 lines
7.6 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 BenchmarkMeasurement type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BenchmarkMeasurement{}
// BenchmarkMeasurement struct for BenchmarkMeasurement
type BenchmarkMeasurement struct {
// Benchmark is the catalog id this answer is about.
Benchmark *string `json:"benchmark,omitempty"`
// Harness is the harness that measures this benchmark for the arena, by repository. Empty when none does, and then a measurement arrives only as a published run's items imported through POST /v1/benchmark/attempts.
Harness *string `json:"harness,omitempty"`
// Latest is the model's latest run on this benchmark — its run id, when it was recorded, its accuracy and how many items it covered — read from the attempts the store already holds. Null when the store holds none.
Latest *BenchmarkRunPoint `json:"latest,omitempty"`
// Note says in a sentence what the answer means: a held measurement served rather than spent again, or nothing queued and why.
Note *string `json:"note,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BenchmarkMeasurement BenchmarkMeasurement
// NewBenchmarkMeasurement instantiates a new BenchmarkMeasurement 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 NewBenchmarkMeasurement() *BenchmarkMeasurement {
this := BenchmarkMeasurement{}
return &this
}
// NewBenchmarkMeasurementWithDefaults instantiates a new BenchmarkMeasurement 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 NewBenchmarkMeasurementWithDefaults() *BenchmarkMeasurement {
this := BenchmarkMeasurement{}
return &this
}
// GetBenchmark returns the Benchmark field value if set, zero value otherwise.
func (o *BenchmarkMeasurement) GetBenchmark() string {
if o == nil || IsNil(o.Benchmark) {
var ret string
return ret
}
return *o.Benchmark
}
// GetBenchmarkOk returns a tuple with the Benchmark field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BenchmarkMeasurement) GetBenchmarkOk() (*string, bool) {
if o == nil || IsNil(o.Benchmark) {
return nil, false
}
return o.Benchmark, true
}
// HasBenchmark returns a boolean if a field has been set.
func (o *BenchmarkMeasurement) HasBenchmark() bool {
if o != nil && !IsNil(o.Benchmark) {
return true
}
return false
}
// SetBenchmark gets a reference to the given string and assigns it to the Benchmark field.
func (o *BenchmarkMeasurement) SetBenchmark(v string) {
o.Benchmark = &v
}
// GetHarness returns the Harness field value if set, zero value otherwise.
func (o *BenchmarkMeasurement) GetHarness() string {
if o == nil || IsNil(o.Harness) {
var ret string
return ret
}
return *o.Harness
}
// GetHarnessOk returns a tuple with the Harness field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BenchmarkMeasurement) GetHarnessOk() (*string, bool) {
if o == nil || IsNil(o.Harness) {
return nil, false
}
return o.Harness, true
}
// HasHarness returns a boolean if a field has been set.
func (o *BenchmarkMeasurement) HasHarness() bool {
if o != nil && !IsNil(o.Harness) {
return true
}
return false
}
// SetHarness gets a reference to the given string and assigns it to the Harness field.
func (o *BenchmarkMeasurement) SetHarness(v string) {
o.Harness = &v
}
// GetLatest returns the Latest field value if set, zero value otherwise.
func (o *BenchmarkMeasurement) GetLatest() BenchmarkRunPoint {
if o == nil || IsNil(o.Latest) {
var ret BenchmarkRunPoint
return ret
}
return *o.Latest
}
// GetLatestOk returns a tuple with the Latest field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BenchmarkMeasurement) GetLatestOk() (*BenchmarkRunPoint, bool) {
if o == nil || IsNil(o.Latest) {
return nil, false
}
return o.Latest, true
}
// HasLatest returns a boolean if a field has been set.
func (o *BenchmarkMeasurement) HasLatest() bool {
if o != nil && !IsNil(o.Latest) {
return true
}
return false
}
// SetLatest gets a reference to the given BenchmarkRunPoint and assigns it to the Latest field.
func (o *BenchmarkMeasurement) SetLatest(v BenchmarkRunPoint) {
o.Latest = &v
}
// GetNote returns the Note field value if set, zero value otherwise.
func (o *BenchmarkMeasurement) GetNote() string {
if o == nil || IsNil(o.Note) {
var ret string
return ret
}
return *o.Note
}
// GetNoteOk returns a tuple with the Note field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BenchmarkMeasurement) GetNoteOk() (*string, bool) {
if o == nil || IsNil(o.Note) {
return nil, false
}
return o.Note, true
}
// HasNote returns a boolean if a field has been set.
func (o *BenchmarkMeasurement) HasNote() bool {
if o != nil && !IsNil(o.Note) {
return true
}
return false
}
// SetNote gets a reference to the given string and assigns it to the Note field.
func (o *BenchmarkMeasurement) SetNote(v string) {
o.Note = &v
}
func (o BenchmarkMeasurement) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BenchmarkMeasurement) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Benchmark) {
toSerialize["benchmark"] = o.Benchmark
}
if !IsNil(o.Harness) {
toSerialize["harness"] = o.Harness
}
if !IsNil(o.Latest) {
toSerialize["latest"] = o.Latest
}
if !IsNil(o.Note) {
toSerialize["note"] = o.Note
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BenchmarkMeasurement) UnmarshalJSON(data []byte) (err error) {
varBenchmarkMeasurement := _BenchmarkMeasurement{}
err = json.Unmarshal(data, &varBenchmarkMeasurement)
if err != nil {
return err
}
*o = BenchmarkMeasurement(varBenchmarkMeasurement)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "benchmark")
delete(additionalProperties, "harness")
delete(additionalProperties, "latest")
delete(additionalProperties, "note")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBenchmarkMeasurement struct {
value *BenchmarkMeasurement
isSet bool
}
func (v NullableBenchmarkMeasurement) Get() *BenchmarkMeasurement {
return v.value
}
func (v *NullableBenchmarkMeasurement) Set(val *BenchmarkMeasurement) {
v.value = val
v.isSet = true
}
func (v NullableBenchmarkMeasurement) IsSet() bool {
return v.isSet
}
func (v *NullableBenchmarkMeasurement) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBenchmarkMeasurement(val *BenchmarkMeasurement) *NullableBenchmarkMeasurement {
return &NullableBenchmarkMeasurement{value: val, isSet: true}
}
func (v NullableBenchmarkMeasurement) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBenchmarkMeasurement) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}