Files
sdk/model_train_options.go

193 lines
4.8 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 TrainOptions type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TrainOptions{}
// TrainOptions struct for TrainOptions
type TrainOptions struct {
// Labels are its option labels, in order: a choice's criteria, a score's levels as text, a noul's two sides.
Labels []string `json:"labels,omitempty"`
// Type is choice, score or noul.
Type *string `json:"type,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TrainOptions TrainOptions
// NewTrainOptions instantiates a new TrainOptions 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 NewTrainOptions() *TrainOptions {
this := TrainOptions{}
return &this
}
// NewTrainOptionsWithDefaults instantiates a new TrainOptions 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 NewTrainOptionsWithDefaults() *TrainOptions {
this := TrainOptions{}
return &this
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *TrainOptions) GetLabels() []string {
if o == nil || IsNil(o.Labels) {
var ret []string
return ret
}
return o.Labels
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainOptions) GetLabelsOk() ([]string, bool) {
if o == nil || IsNil(o.Labels) {
return nil, false
}
return o.Labels, true
}
// HasLabels returns a boolean if a field has been set.
func (o *TrainOptions) HasLabels() bool {
if o != nil && !IsNil(o.Labels) {
return true
}
return false
}
// SetLabels gets a reference to the given []string and assigns it to the Labels field.
func (o *TrainOptions) SetLabels(v []string) {
o.Labels = v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *TrainOptions) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrainOptions) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *TrainOptions) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *TrainOptions) SetType(v string) {
o.Type = &v
}
func (o TrainOptions) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TrainOptions) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Labels) {
toSerialize["labels"] = o.Labels
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TrainOptions) UnmarshalJSON(data []byte) (err error) {
varTrainOptions := _TrainOptions{}
err = json.Unmarshal(data, &varTrainOptions)
if err != nil {
return err
}
*o = TrainOptions(varTrainOptions)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "labels")
delete(additionalProperties, "type")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTrainOptions struct {
value *TrainOptions
isSet bool
}
func (v NullableTrainOptions) Get() *TrainOptions {
return v.value
}
func (v *NullableTrainOptions) Set(val *TrainOptions) {
v.value = val
v.isSet = true
}
func (v NullableTrainOptions) IsSet() bool {
return v.isSet
}
func (v *NullableTrainOptions) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTrainOptions(val *TrainOptions) *NullableTrainOptions {
return &NullableTrainOptions{value: val, isSet: true}
}
func (v NullableTrainOptions) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTrainOptions) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}