Files
sdk/model_benchmark_suite.go

206 lines
5.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"
"fmt"
)
// checks if the BenchmarkSuite type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BenchmarkSuite{}
// BenchmarkSuite struct for BenchmarkSuite
type BenchmarkSuite struct {
// Benchmarks are the catalog ids to ask about. At least one is required, and every id must be in the catalog.
Benchmarks []string `json:"benchmarks"`
// Model is the model to ask about, by the id its attempts are stored under. Required.
Model *string `json:"model,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BenchmarkSuite BenchmarkSuite
// NewBenchmarkSuite instantiates a new BenchmarkSuite 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 NewBenchmarkSuite(benchmarks []string) *BenchmarkSuite {
this := BenchmarkSuite{}
this.Benchmarks = benchmarks
return &this
}
// NewBenchmarkSuiteWithDefaults instantiates a new BenchmarkSuite 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 NewBenchmarkSuiteWithDefaults() *BenchmarkSuite {
this := BenchmarkSuite{}
return &this
}
// GetBenchmarks returns the Benchmarks field value
func (o *BenchmarkSuite) GetBenchmarks() []string {
if o == nil {
var ret []string
return ret
}
return o.Benchmarks
}
// GetBenchmarksOk returns a tuple with the Benchmarks field value
// and a boolean to check if the value has been set.
func (o *BenchmarkSuite) GetBenchmarksOk() ([]string, bool) {
if o == nil {
return nil, false
}
return o.Benchmarks, true
}
// SetBenchmarks sets field value
func (o *BenchmarkSuite) SetBenchmarks(v []string) {
o.Benchmarks = v
}
// GetModel returns the Model field value if set, zero value otherwise.
func (o *BenchmarkSuite) 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 *BenchmarkSuite) 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 *BenchmarkSuite) 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 *BenchmarkSuite) SetModel(v string) {
o.Model = &v
}
func (o BenchmarkSuite) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BenchmarkSuite) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["benchmarks"] = o.Benchmarks
if !IsNil(o.Model) {
toSerialize["model"] = o.Model
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BenchmarkSuite) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"benchmarks",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varBenchmarkSuite := _BenchmarkSuite{}
err = json.Unmarshal(data, &varBenchmarkSuite)
if err != nil {
return err
}
*o = BenchmarkSuite(varBenchmarkSuite)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "benchmarks")
delete(additionalProperties, "model")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBenchmarkSuite struct {
value *BenchmarkSuite
isSet bool
}
func (v NullableBenchmarkSuite) Get() *BenchmarkSuite {
return v.value
}
func (v *NullableBenchmarkSuite) Set(val *BenchmarkSuite) {
v.value = val
v.isSet = true
}
func (v NullableBenchmarkSuite) IsSet() bool {
return v.isSet
}
func (v *NullableBenchmarkSuite) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBenchmarkSuite(val *BenchmarkSuite) *NullableBenchmarkSuite {
return &NullableBenchmarkSuite{value: val, isSet: true}
}
func (v NullableBenchmarkSuite) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBenchmarkSuite) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}