Files
sdk/model_benchmark_measurements.go

269 lines
7.0 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 BenchmarkMeasurements type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BenchmarkMeasurements{}
// BenchmarkMeasurements struct for BenchmarkMeasurements
type BenchmarkMeasurements struct {
// By is the verified user who asked.
By *string `json:"by,omitempty"`
// Data is one answer per benchmark, in the order the request named them.
Data []BenchmarkMeasurement `json:"data,omitempty"`
// Model is the model asked about.
Model *string `json:"model,omitempty"`
// Org is the caller's verified org.
Org *string `json:"org,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BenchmarkMeasurements BenchmarkMeasurements
// NewBenchmarkMeasurements instantiates a new BenchmarkMeasurements 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 NewBenchmarkMeasurements() *BenchmarkMeasurements {
this := BenchmarkMeasurements{}
return &this
}
// NewBenchmarkMeasurementsWithDefaults instantiates a new BenchmarkMeasurements 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 NewBenchmarkMeasurementsWithDefaults() *BenchmarkMeasurements {
this := BenchmarkMeasurements{}
return &this
}
// GetBy returns the By field value if set, zero value otherwise.
func (o *BenchmarkMeasurements) GetBy() string {
if o == nil || IsNil(o.By) {
var ret string
return ret
}
return *o.By
}
// GetByOk returns a tuple with the By field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BenchmarkMeasurements) GetByOk() (*string, bool) {
if o == nil || IsNil(o.By) {
return nil, false
}
return o.By, true
}
// HasBy returns a boolean if a field has been set.
func (o *BenchmarkMeasurements) HasBy() bool {
if o != nil && !IsNil(o.By) {
return true
}
return false
}
// SetBy gets a reference to the given string and assigns it to the By field.
func (o *BenchmarkMeasurements) SetBy(v string) {
o.By = &v
}
// GetData returns the Data field value if set, zero value otherwise.
func (o *BenchmarkMeasurements) GetData() []BenchmarkMeasurement {
if o == nil || IsNil(o.Data) {
var ret []BenchmarkMeasurement
return ret
}
return o.Data
}
// GetDataOk returns a tuple with the Data field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BenchmarkMeasurements) GetDataOk() ([]BenchmarkMeasurement, bool) {
if o == nil || IsNil(o.Data) {
return nil, false
}
return o.Data, true
}
// HasData returns a boolean if a field has been set.
func (o *BenchmarkMeasurements) HasData() bool {
if o != nil && !IsNil(o.Data) {
return true
}
return false
}
// SetData gets a reference to the given []BenchmarkMeasurement and assigns it to the Data field.
func (o *BenchmarkMeasurements) SetData(v []BenchmarkMeasurement) {
o.Data = v
}
// GetModel returns the Model field value if set, zero value otherwise.
func (o *BenchmarkMeasurements) GetModel() string {
if o == nil || IsNil(o.Model) {
var ret string
return ret
}
return *o.Model
}
// GetModelOk returns a tuple with the Model field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BenchmarkMeasurements) GetModelOk() (*string, bool) {
if o == nil || IsNil(o.Model) {
return nil, false
}
return o.Model, true
}
// HasModel returns a boolean if a field has been set.
func (o *BenchmarkMeasurements) HasModel() bool {
if o != nil && !IsNil(o.Model) {
return true
}
return false
}
// SetModel gets a reference to the given string and assigns it to the Model field.
func (o *BenchmarkMeasurements) SetModel(v string) {
o.Model = &v
}
// GetOrg returns the Org field value if set, zero value otherwise.
func (o *BenchmarkMeasurements) GetOrg() string {
if o == nil || IsNil(o.Org) {
var ret string
return ret
}
return *o.Org
}
// GetOrgOk returns a tuple with the Org field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BenchmarkMeasurements) GetOrgOk() (*string, bool) {
if o == nil || IsNil(o.Org) {
return nil, false
}
return o.Org, true
}
// HasOrg returns a boolean if a field has been set.
func (o *BenchmarkMeasurements) HasOrg() bool {
if o != nil && !IsNil(o.Org) {
return true
}
return false
}
// SetOrg gets a reference to the given string and assigns it to the Org field.
func (o *BenchmarkMeasurements) SetOrg(v string) {
o.Org = &v
}
func (o BenchmarkMeasurements) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BenchmarkMeasurements) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.By) {
toSerialize["by"] = o.By
}
if !IsNil(o.Data) {
toSerialize["data"] = o.Data
}
if !IsNil(o.Model) {
toSerialize["model"] = o.Model
}
if !IsNil(o.Org) {
toSerialize["org"] = o.Org
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BenchmarkMeasurements) UnmarshalJSON(data []byte) (err error) {
varBenchmarkMeasurements := _BenchmarkMeasurements{}
err = json.Unmarshal(data, &varBenchmarkMeasurements)
if err != nil {
return err
}
*o = BenchmarkMeasurements(varBenchmarkMeasurements)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "by")
delete(additionalProperties, "data")
delete(additionalProperties, "model")
delete(additionalProperties, "org")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBenchmarkMeasurements struct {
value *BenchmarkMeasurements
isSet bool
}
func (v NullableBenchmarkMeasurements) Get() *BenchmarkMeasurements {
return v.value
}
func (v *NullableBenchmarkMeasurements) Set(val *BenchmarkMeasurements) {
v.value = val
v.isSet = true
}
func (v NullableBenchmarkMeasurements) IsSet() bool {
return v.isSet
}
func (v *NullableBenchmarkMeasurements) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBenchmarkMeasurements(val *BenchmarkMeasurements) *NullableBenchmarkMeasurements {
return &NullableBenchmarkMeasurements{value: val, isSet: true}
}
func (v NullableBenchmarkMeasurements) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBenchmarkMeasurements) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}